Davide Setti | 2 Jul 10:34 2015
Picon

uwsgi, legions and docker

Hello,
I'm using uwsgi (2.0.10) legions to have a single celery beat on a EC2 container service cluster. This is how I run uwsgi:

docker run -it --rm -p 9988:9988 myimage uwsgi --legion "legion 0.0
.0.0:9988 90 bf-cbc:cucu"

then I un another container on another host, but they don't connect each other. Debugging, I noticed a strange thing, that I don't understand:

# telnet 127.0.0.1 9988
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.

Using the eth0 address:

# telnet 172.31.15.245 9988
Trying 172.31.15.245...
telnet: Unable to connect to remote host: Connection refused

I'm not able to connect using the external address! Port binding works for the HTTP uwsgi port (another container).

Suggestions?

Thanks
--

Davide Setti
code: http://github.com/vad
_______________________________________________
uWSGI mailing list
uWSGI@...
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
Roberto De Ioris | 1 Jul 09:26 2015
Picon

[ANNOUNCE] uWSGI 2.0.11

Hi, a new LTS release is available

http://uwsgi-docs.readthedocs.org/en/latest/Changelog-2.0.11.html

This release is mainly a bugfix one.

An interesting new feature is the --wait-for-socket option that suspends
an instance execution until a tcp/unix socket is ready (this could be very
useful to synchronize vassals spawn)

--

-- 
Roberto De Ioris
http://unbit.com
Damjan Georgievski | 27 Jun 01:14 2015
Picon

empty SCRIPT_NAME when using php-app

I have no idea what the correct behaviour here is, but at least Slim
the PHP framework fails when used with --php-app, and it complains
about the empty SCRIPT_NAME
SCRIPT_NAME seems to be empty in uwsgi in both cases on the uwsgi
level, but when in php in the first case (php-app) it's again empty,
in the second (php-index) it's magically filled.
interesting that in the first case, even though uwsgi knows about
PATH_INFO, php doesn't return any $_SERVER['PATH_INFO']

This is latest uwsgi from git: 056417303c

=== index.php ===

<?php
     echo 'SCRIPT_NAME => ' . $_SERVER['SCRIPT_NAME'] . "\n";
     echo 'PATH_INFO => ' . $_SERVER['PATH_INFO'] . "\n";
     echo 'REQUEST_URI => ' . $_SERVER['REQUEST_URI'] . "\n";

== php-app ===

~/src/uwsgi/uwsgi -M --http-socket :8080 --http-socket-modifier1 14
--php-app index.php

add uwsgi var: REQUEST_METHOD = GET
add uwsgi var: REQUEST_URI = /asdsa
add uwsgi var: PATH_INFO = /asdsa
add uwsgi var: QUERY_STRING =
add uwsgi var: SERVER_PROTOCOL = HTTP/1.1
add uwsgi var: SCRIPT_NAME =
add uwsgi var: SERVER_NAME = archaeopteryx
add uwsgi var: SERVER_PORT = 8080
add uwsgi var: REMOTE_ADDR = 127.0.0.1
[uWSGI DEBUG] PATH_INFO=/asdsa
[uWSGI DEBUG] SCRIPT_NAME=
[uWSGI DEBUG] SERVER_NAME=archaeopteryx
[uWSGI DEBUG] HTTP_HOST=localhost:8080
php filename = index.php script_name =  (0) document_root =
/home/damjan/my-work/phar-test (30)
[pid: 29650|app: -1|req: -1/1] 127.0.0.1 () {24 vars in 265 bytes}
[Sat Jun 27 01:03:48 2015] GET /asdsa => generated 52 bytes in 0 msecs
(HTTP/1.1 200) 2 headers in 85 bytes (0 switches on core 0)

$ curl localhost:8080/asdsa
SCRIPT_NAME =>
PATH_INFO =>
REQUEST_URI => /asdsa

=== php-index ===

$ ~/src/uwsgi/uwsgi -M --http-socket :8080 --http-socket-modifier1 14
--php-index index.php

add uwsgi var: REQUEST_METHOD = GET
add uwsgi var: REQUEST_URI = /index.php/asdsa
add uwsgi var: PATH_INFO = /index.php/asdsa
add uwsgi var: QUERY_STRING =
add uwsgi var: SERVER_PROTOCOL = HTTP/1.1
add uwsgi var: SCRIPT_NAME =
add uwsgi var: SERVER_NAME = archaeopteryx
add uwsgi var: SERVER_PORT = 8080
add uwsgi var: REMOTE_ADDR = 127.0.0.1
[uWSGI DEBUG] PATH_INFO=/index.php/asdsa
[uWSGI DEBUG] SCRIPT_NAME=
[uWSGI DEBUG] SERVER_NAME=archaeopteryx
[uWSGI DEBUG] HTTP_HOST=localhost:8080
php filename = /home/damjan/my-work/phar-test/index.php script_name =
/index.php (10) document_root = /home/damjan/my-work/phar-test (30)
[pid: 29726|app: -1|req: -1/4] 127.0.0.1 () {24 vars in 285 bytes}
[Sat Jun 27 01:06:13 2015] GET /index.php/asdsa => generated 78 bytes
in 0 msecs (HTTP/1.1 200) 2 headers in 85 bytes (0 switches on core 0)

$ curl localhost:8080/index.php/asdsa
SCRIPT_NAME => /index.php
PATH_INFO => /asdsa
REQUEST_URI => /index.php/asdsa

--

-- 
damjan
kristian kvilekval | 23 Jun 01:54 2015
Picon

evaluation order

Trying to get subscriptions working with docker containers and in certain situation 
I need to override the place holder variable bisque_uwsgi_addr when 
a specific environement VARIABLE is set.  However, I never see it overridden?




Any help appreciated.


$ env | fgrep BISQUE
BISQUE_FASTROUTER_KEYS=bisque
BISQUE_UWSGI_ADDR=10.140.65.108:3033
...

[uwsgi]
....


fastrouter_keys = $(BISQUE_FASTROUTER_KEYS)
fastrouter_ip = $(FASTROUTER_PORT_3017_TCP_ADDR)
fastrouter_port = 3017

bisque_uwsgi_addr = %(socket)
if-env= BISQUE_UWSGI_ADDR
bisque_uwsgi_addr = $(BISQUE_UWSGI_ADDR)
endif = 

# Subscribe this instance to a fastrouter
#subscribe-to=%(fastrouter_ip):%(fastrouter_port):%(fastrouter_keys)
for-readline = /bisque/config/fastkeys
subscribe2= server=%(fastrouter_ip):%(fastrouter_port),key=%(_),addr=%(bisque_uwsgi_addr)
endfor =

=====================================


On the fastrouter I see the internal node being sent ..


[uwsgi-subscription for pid 5] bisque => new node: 172.17.0.34:3033


If I change the config to read . 
#bisque_uwsgi_addr = %(socket)
#if-env= BISQUE_UWSGI_ADDR
bisque_uwsgi_addr = $(BISQUE_UWSGI_ADDR)
#endif = 

Then I see 
[uwsgi-subscription for pid 5] bisque => new node: 10.140.65.108:3033


_______________________________________________
uWSGI mailing list
uWSGI@...
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
Javier Guerra Giraldez | 19 Jun 21:37 2015

revisiting old code

Hi.

After a long, long time, I'm reviewing the RADOS plugin with the
intent of adding a couple features.  But i can't make the current
version work with any non-root mountpoint.

the issue seems related to this line in rados.c [1]:

    wsgi_req->app_id = uwsgi_get_app_id(
        wsgi_req,
        wsgi_req->appid, wsgi_req->appid_len,
        rados_plugin.modifier1);

this line hasn't been modified since the first code draft, and was
copied from the glusterfs plugin, where it's also unchanged.

in my tests, the `wsgi_req->appid` field is empty (null pointer,
len=0), so the uwsgi_get_app_id() always returns -1.

has this field changed in recent versions? or maybe it wasn't the
correct field from the start?

[1]https://github.com/javierguerragiraldez/uwsgi/blob/master/plugins/rados/rados.c#L547

--

-- 
Javier
Jens Tröger | 18 Jun 15:58 2015
Picon

OSError: timeout during read(8192) on wsgi.input

Hi,

I'm running a Pyramid server through uwsgi and today I saw a couple of
exceptions (OSError: timeout during read(8192) on wsgi.input).  All of
them were preceeded by failures like

  [uwsgi-body-read] Timeout reading 8192 bytes. Content-Length: 9784500 consumed: 8683520 left: 1100980

Is this because the client's connection drops and the request is
incomplete?

Is there a more graceful way of handling this?  Is there a way of
checking for this failure on the Pyramid side?

Thanks!
Jens

--

-- 
Jens Tröger
http://savage.light-speed.de/
Davide Setti | 16 Jun 14:44 2015
Picon

traceback/profile of slow redirects in django

Hi,
i've noticed that every 10/20 redirects, from "/path" to "/path/", one of them is very slow. They all take 1ms, except some of them that take 0.5-3s. Is there a way to configure uwsgi to save traceback and/or a profile file for these slow requests in production?

Thanks
--

Davide Setti
code: http://github.com/vad
_______________________________________________
uWSGI mailing list
uWSGI@...
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
C Anthony Risinger | 16 Jun 08:42 2015

Send websocket termination sequence on dead connections

Hello,

Does/can the websocket impl send a last ditch "termination frame" to the client after a PONG failure? Seems to be up to client libraries to decide how long the time out will be until reconnect.

We are stress testing a custom websocket event server in python, and software bugs (greenlets running too long) appear to create situations where the PONG is handled too late, despite the client sending on time.

The server discos but the client doesn't know that. If we think a connection is dead, could/should we blindly attempt sending a term frame (2 bytes?) before closing the underlying socket?

--

C Anthony

_______________________________________________
uWSGI mailing list
uWSGI@...
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
kristian kvilekval | 16 Jun 06:08 2015
Picon

fastrouter configuration

I am trying to configure fastrouter through environment variable and running into trouble.

1.  A blank loop still seems to run.. I expected that no subscription would take place when the for was empty?

[uwsgi]
...
fastrouter_keys=
fastrouter_ip=
fastrouter_port=

# Subscribe this instance to a fastrouter
for=%(fastrouter_keys)
subscribe-to=%(fastrouter_ip):%(fastrouter_port):%(_)
endfor=

and the log ...

subscribing to ::
send_subscription()/sendto(): Invalid argument [core/subscription.c line 665]
send_subscription()/sendto(): Invalid argument [core/subscription.c line 665]
send_subscription()/sendto(): Invalid argument [core/subscription.c line 665]



2.  A list of values is treated single?

export FASTROUTER_KEYS="a b c"

[uwsgi]
fastrouter_keys=$(FASTROUTER_KEYS)
fastrouter_ip=...
fastrouter_port=...

# Subscribe this instance to a fastrouter
for=%(fastrouter_keys)
subscribe-to=%(fastrouter_ip):%(fastrouter_port):%(_)
endfor=

And logs on fastrouter 

[uwsgi-subscription for pid 5] new pool: a b c (hash key: 3007)
fastrouter_1 | [uwsgi-subscription for pid 5] a b c => new node: 172.17.1.37:56481

I was expecting to see three separate subscribes.


Any help appreciated.
_______________________________________________
uWSGI mailing list
uWSGI@...
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
Davide Setti | 12 Jun 23:45 2015
Picon

gzip and static files

Hello,

I'm trying to configure uWSGI [uWSGI 2.0.10 (64bit)] to gzip the content of a Django website. It works for contents generated by Django, but it doesn't for static files (using --static-map).

I know that it's possible to generate *gz at build time and let uwsgi serve them, but we're using cloudfront with far expire headers. Static resources are only asked once from Cloudfront and I'd like to avoid adding complexity to the build step.

A simple configuration to test the issue:

uwsgi --http :8000 --static-map=/static=/tmp/ --response-route-if='contains:${HTTP_ACCEPT_ENCODING};gzip gzip:'

Is this a known issue? Is there a workaround?

Thanks
--

Davide Setti
code: http://github.com/vad
_______________________________________________
uWSGI mailing list
uWSGI@...
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
Tim Tisdall | 8 Jun 21:58 2015
Picon

see DeprecationWarning

I was reading how the default for python is to hide DeprecationWarning messages.  For development, I'd like to make sure I see any DeprecationWarning that come up, but I don't seem to see any similar option in uwsgi.  Can anyone tell me if it's on or off by default and if there's a way to change that setting?
_______________________________________________
uWSGI mailing list
uWSGI@...
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Gmane