Hello All (sending again since first time did not go through),



I am experimenting with Ngnix + fastrouter subscriptions for scaling
and have run into a snag.

Summary:
  1. Fast router using cheap mode never dispatches to subscribed servers.
  2. A fastrouter only will dispatch to subscribed servers

Conclusion: something about my configs does not allow cheap mode to work.

Any help would be appreciated:

Here's my configs (fastrouter and fastworker) and logs:

I am launching with :

uwsgi --ini-paste fastrouter.ini
ussgi --ini-paste fastworker.ini

tested with:
curl -k https://loup.ece.ucsb.edu/data_service
curl -k https://loup.ece.ucsb.edu/data_service
curl -k https://loup.ece.ucsb.edu/data_service

I was expecting to see load-balancing between the main server and the
worker.


Thank,
Kris





## fastrouter.ini
[app:main]
use = config:site.cfg
bisque.services_enabled =
bisque.services_disabled = engine_service

bisque.static_files = True
bisque.server = https://loup.ece.ucsb.edu
[uwsgi]
virtualenv = /home/kgk/work/bisque/bq057/bqenv
stats = /tmp/stats.socket

;create a shared socket (the webserver will connect to it)
plugins = fastrouter
#shared-socket = 127.0.0.1:3031
shared-socket = /tmp/bisque.sock
chmod-socket = 666

; bind the fastrouter to the shared socket
fastrouter = =0
; bind an instance to the same socket
socket = =0

; having a master is always a good thing...
master = true
; our subscription server
fastrouter-subscription-server = 127.0.0.1:3017
; a bunch of processes
processes = 2
; and put the fastrouter in cheap mode
fastrouter-cheap = true

# post-buffering : buffer post large
post-buffering = 1
#buffer-size : internal buffer size for uwsgi packet parsing.
buffer-size = 8192



###############################
# fastworker.ini
[app:main]
use = config:site.cfg
bisque.services_enabled =
bisque.services_disabled = engine_service

bisque.static_files = True
bisque.server = https://loup.ece.ucsb.edu

[uwsgi]
virtualenv = /home/kgk/work/bisque/bq057/bqenv
stats = /tmp/stats1.socket
#plugins = python
master = true
processes = 1
#threads = 4
heartbeat = 10
socket = 127.0.0.1:0
#subscribe2 = server=127.0.0.1:3017,key=loup.ece.ucsb.edu
subscribe-to = 127.0.0.1:3017:loup.ece.ucsb.edu
#subscribe-to = 127.0.0.1:3017:localhost

#wsgi = app
vacuum = true
#harakiri = 10
max-requests = 100
#logformat = %(addr) - %(user) [%(ltime)] "%(method) %(uri) %(proto)"
%(status) %(size) "%(referer)" "%(uagent)"

#path to the virtualenv under which to run

# post-buffering : buffer post large
post-buffering = 1

#buffer-size : internal buffer size for uwsgi packet parsing.
buffer-size = 8192



################################################################

[uWSGI] getting INI configuration from
/home/kgk/work/bisque/bq057/config//fastrouter.ini
open("./fastrouter_plugin.so"): No such file or directory [core/utils.c
line 3675]
!!! UNABLE to load uWSGI plugin: ./fastrouter_plugin.so: cannot open shared
object file: No such file or directory !!!
*** Starting uWSGI 2.0.10 (64bit) on [Tue May 26 10:33:23 2015] ***
compiled with version: 4.7.2 on 06 May 2015 10:22:03
os: Linux-3.16-0.bpo.2-amd64 #1 SMP Debian 3.16.3-2~bpo70+1 (2014-09-21)
nodename: loup
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 16
current working directory: /home/kgk/work/bisque/bq057
detected binary path: /home/kgk/work/bisque/bq057/bqenv/bin/uwsgi
uwsgi shared socket 0 bound to UNIX address /tmp/bisque.sock fd 3
uwsgi socket 0 mapped to shared socket 0 (/tmp/bisque.sock) fd 3
your processes number limit is 193509
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI fastrouter bound on /tmp/bisque.sock fd 3
uWSGI fastrouter subscription server bound on 127.0.0.1:3017 fd 4
starting uWSGI fastrouter in cheap mode
Python version: 2.7.3 (default, Mar 13 2014, 11:26:58)  [GCC 4.7.2]
Set PythonHome to /home/kgk/work/bisque/bq057/bqenv
*** Python threads support is disabled. You can enable it with
--enable-threads ***
Python main interpreter initialized at 0x153e640
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 10 seconds
mapped 170112 bytes (166 KB) for 1 cores
*** Operational MODE: single process ***
Loading paste environment:
config:/home/kgk/work/bisque/bq057/config/h1_uwsgi.cfg
WSGI app 0 (mountpoint='') ready in 4 seconds on interpreter 0x153e640 pid:
9954 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 9954)
spawned uWSGI worker 1 (pid: 10051, cores: 1)
*** Stats server enabled on /tmp/stats.socket fd: 12 ***
spawned uWSGI fastrouter 1 (pid: 10052)
[uwsgi-subscription for pid 10052] new pool: loup.ece.ucsb.edu (hash key:
4395)
[uwsgi-subscription for pid 10052] loup.ece.ucsb.edu => new node:
127.0.0.1:37918
epoll_ctl(): Invalid argument [core/event.c line 521]
[uWSGI fastrouter pid 10052] leaving cheap mode...
[uwsgi-subscription for pid 10052] loup.ece.ucsb.edu => new node:
127.0.0.1:45335
[uwsgi-subscription for pid 10052] loup.ece.ucsb.edu => new node:
127.0.0.1:56723
loup.ece.ucsb.edu GET /data_service [200]
loup.ece.ucsb.edu GET /data_service [200]
loup.ece.ucsb.edu GET /data_service [200]

############################################

$ uwsgi --ini-paste config/fastworker.ini
[uWSGI] getting INI configuration from config/fastworker.ini
*** Starting uWSGI 2.0.10 (64bit) on [Tue May 26 10:33:41 2015] ***
compiled with version: 4.7.2 on 06 May 2015 10:22:03
os: Linux-3.16-0.bpo.2-amd64 #1 SMP Debian 3.16.3-2~bpo70+1 (2014-09-21)
nodename: loup
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 16
current working directory: /home/kgk/work/bisque/bq057
detected binary path: /home/kgk/work/bisque/bq057/bqenv/bin/uwsgi
your processes number limit is 193509
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:56723 (port auto-assigned) fd
3
Python version: 2.7.3 (default, Mar 13 2014, 11:26:58)  [GCC 4.7.2]
Set PythonHome to /home/kgk/work/bisque/bq057/bqenv
*** Python threads support is disabled. You can enable it with
--enable-threads ***
Python main interpreter initialized at 0x1f186f0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 170112 bytes (166 KB) for 1 cores
*** Operational MODE: single process ***
Loading paste environment:
config:/home/kgk/work/bisque/bq057/config/fastworker.ini
WSGI app 0 (mountpoint='') ready in 4 seconds on interpreter 0x1f186f0 pid:
10064 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 10064)
spawned uWSGI worker 1 (pid: 10158, cores: 1)
*** Stats server enabled on /tmp/stats1.socket fd: 9 ***
subscribing to 127.0.0.1:3017:loup.ece.ucsb.edu
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to