venediktov / vanilla-rtb

Real Time Bidding (RTB) - Demand Side Platform framework

Home Page:http://forkbid.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run project in web browser

reoxey opened this issue · comments

on running run.sh
cd Release/examples/bin
./http_bidder_test --config etc/config.cfg
./cache_loader_test --config etc/config.cfg
./exchange_handler_test --config etc/config.cfg
./mock_bidder_test --config etc/config.cfg
./multi_bidder --config etc/config.cfg
./multi_exchange_handler --config etc/config.cfg
./notification_service_test --config etc/config.cfg
./slavebanker_service_test --config etc/config.cfg
./campaign_manager_test --config etc/config.cfg

i get this output in terminal..
reoxey@reoxey-desktop:~/CLionProjects/vanilla-rtb$ sh ./run.sh

[2017-06-17 12:42:39.832061] [0x00007f3f5e222900] [debug]   bidder.ads_ipc_name vanilla-ads-ipc
bidder.ads_source data/ads
bidder.campaign_data_ipc_name vanilla-campaign-data-ipc
bidder.campaign_data_source data/campaign_data
bidder.concurrency 0
bidder.geo_ad_ipc_name vanilla-geo-ad-ipc
bidder.geo_ad_source data/ad_geo
bidder.geo_campaign_ipc_name vanilla-geo-campaign-ipc
bidder.geo_campaign_source data/geo_campaign
bidder.geo_ipc_name vanilla-geo-ipc
bidder.geo_source data/geo
bidder.host 0.0.0.0
bidder.key_value_host 0.0.0.0
bidder.key_value_port 0
bidder.log /tmp/bidder_log
bidder.port 9081
bidder.root .
bidder.timeout 50
config etc/config.cfg

12:42:39.924693: <info> 
ad load : elapsed_sec=0|elapsed_ms=32|elapsed_mu=32341|elapsed_ns=32341990|
geo_data load : elapsed_sec=0|elapsed_ms=9|elapsed_mu=9912|elapsed_ns=9912520|
geo_campaign load : elapsed_sec=0|elapsed_ms=48|elapsed_mu=48943|elapsed_ns=48943310|
selector load : elapsed_sec=0|elapsed_ms=91|elapsed_mu=91217|elapsed_ns=91217176|
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
  what():  resolve: Host not found (authoritative)
Aborted (core dumped)
[2017-06-17 12:42:41.621299] [0x00007f298fae9780] [debug]   bidder.campaign_data_ipc_name vanilla-campaign-data-ipc
bidder.campaign_data_source data/campaign_data
bidder.geo_campaign_ipc_name vanilla-geo-campaign-ipc
bidder.geo_campaign_source data/geo_campaign
cache-loader.host 0.0.0.0
cache-loader.log /tmp/vanilla_cache_loader_log
cache-loader.port 10081
cache-loader.root .
config etc/config.cfg
datacache.ads_ipc_name vanilla-ads-ipc
datacache.ads_source bidder/data/ads
datacache.geo_ad_ipc_name vanilla-geo-ad-ipc
datacache.geo_ad_source bidder/data/ad_geo
datacache.geo_ipc_name vanilla-geo-ipc
datacache.geo_source bidder/data/geo

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
  what():  resolve: Host not found (authoritative)
Aborted (core dumped)
[2017-06-17 12:42:41.733372] [0x00007f7cb43da800] [debug]   config etc/config.cfg
exchange.host 0.0.0.0
exchange.log /tmp/openrtb_handler_log
exchange.port 8081
exchange.root .
exchange.v1.timeout 100
exchange.v2.timeout 80
mock-bidder.num_of_bidders 5
mock-bidder.port 5000

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
  what():  resolve: Host not found (authoritative)
Aborted (core dumped)
12:42:41.845543: <info> Starting mock bidder pid=9545
12:42:41.846075: <info> Starting mock bidder pid=9546
12:42:41.846144: <info> Starting mock bidder pid=9547
12:42:41.846563: <info> Starting mock bidder pid=9548
12:42:41.846910: <info> Starting mock bidder pid=9549

when i try to open localhost:11081 or localhost:11081/campaign, this error shows up.

This site can’t be reached
localhost refused to connect.

what am i doing wrong?

Hi reoxey,

  1. Can you please send output from command
    ifconfig -a
    I need to see how your network interfaces configured on your machine

  2. I also need to see output of this command
    python -c 'import socket; print socket.getaddrinfo("0.0.0.0", 11081, 0, 0, socket.IPPROTO_TCP, socket.AI_ADDRCONFIG)'

  3. the http UI is only for campaign budget management , so can you just
    start it standalone by following command.
    ./campaign_manager_test --config etc/config.cfg

  4. you have to choose the model of the bidder , a.) either the simplest http_bidder_test that has both exchange handler + embedded bidder code OR b.) multi-bidder example that consists of

./multi_bidder --config etc/config.cfg
./multi_exchange_handler --config etc/config.cfg

The multi-bidder is useful for very large DSP shops where you have 1 million campaigns/clients and so the only way we thought to tackle it is to segregate
1 million campaigns as segments , so each stack on each machine would have unique set of campaigns. For your project I recommend simple http_bidder_test.cpp and if you need to load balance the load between those handlers to achieve minimum latency use NGINX . In this model your handlers will run on either same IP address / different ports for each http_bidder_test or same port/ different IP - each stack will have its own config with IP/port.
In our tests we run all on the same machine and keep all campaigns together for multi-bidders.
We haven't assembled complete DSP in the examples , you are dealing with pieces that represent
a bidder engine.
We pre-generated 1000 campaign ads and 1000 campaign budgets by python script which is hooked up to our build system , so when you run
make -j4 install
as you probably see campaign raw data and everything else is published under
Release/examples/bin

The bidder can be tested with suit of curl*.sh scripts and the performance is tested by ab.sh script
ab.sh -n20000 -c 10 --bidder when testing http_bidder_test . When testing other examples curl.sh and ab.sh also accepts other parameters
giving you snapshot from curl.sh script
LONGOPTS="help,version,auction,mock-bidders,bidder,multi-bidder,c:n:"
snapshot from ab.sh

SHORTOPTS="hvta:c:n:"
LONGOPTS="help,version,auction,mock-bidders,bidder,multi-bidder,test"

You can read the scripts to see what parameters need to be passed to test different executables.

Waiting for your response with your network configuration output ...

here's the output...

reoxey@reoxey-desktop:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 74:e6:e2:10:d4:c6  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4370 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4370 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:271711 (271.7 KB)  TX bytes:271711 (271.7 KB)

wlan0     Link encap:Ethernet  HWaddr 10:08:b1:b1:3e:37  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:13272 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12305 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10864680 (10.8 MB)  TX bytes:2473278 (2.4 MB)

here's the second one...

reoxey@reoxey-desktop:~$ python -c 'import socket; print socket.getaddrinfo("0.0.0.0", 11081, 0, 0, socket.IPPROTO_TCP, socket.AI_ADDRCONFIG)'
[(2, 1, 6, '', ('0.0.0.0', 11081))]

The error in your log suggest there is an issue with resolving ip address

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
  what():  resolve: Host not found (authoritative)
Aborted (core dumped)

When I googled for this error resolve: Host not found (authoritative)
it pointed to misconfiguration of network.

By default, the resolver takes the option `address_configured', which only returns IP addresses if a non-loopback address is configured.

from your ifconfig -a output I only see lo aka Local Loopback configured with IP 127.0.0.1, but I don't see other network interfaces configured with IP address . Neither wireless - wlan0 nor fixed eth0
has IP address.
The code that fails is most likely this one
https://github.com/venediktov/vanilla-rtb/blob/master/CRUD/service/server.hpp#L63
You can try changing it from
boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve({address, port});
to this one
boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve({address, port, boost::asio::ip::resolver_query_base::flags(0)});
And let me know if that helps even without changing your network configuration.

Just run capaign_manager test alone for now , because that's the one that you tried connecting your browser to.
./campaign_manager_test --config etc/config.cfg
You should get this output

campaign-manager.host 0.0.0.0
campaign-manager.ipc_name vanilla-campaign-budget-ipc
campaign-manager.log /tmp/campaign_manager_log
campaign-manager.port 11081
campaign-manager.root www
config etc/config.cfg

Without errors and the process should keep running . Then you connect your browser to http://localhost:11081/campaign/index.html

You must add index.html at the end for now.

2.) your run.sh is not correct , it will only start first example and will not proceed to the next our processes don't exit after start up . However , because every process in your case experienced same issue and aborted you were able to execute one after another.

yeah it worked, thanks.

If you want to talk to us about your project you can send email to info@forkbid.com perhaps we could help in exchange for web development? We need to revamp our web site.