[uWSGI] python 2.7 to 3.6 - please advise on framework to use

2017-07-16 Thread David Montgomery
Hi, I have used flask/bottle with nginx/uWSGI gevent loop with great success for 2.7 Its now time for me to move on up to 3.6 I see that uWSGI supports asyncio but does not appear that the use of asyncio with flask is heavily supported by the community What are the python 3.6 frameworks as clos

Re: [uWSGI] python 2.7 to 3.6 - please advise on framework to use

2017-07-17 Thread David Montgomery
help On Mon, Jul 17, 2017 at 5:28 PM, Curtis Maloney wrote: > On 17/07/17 15:57, David Montgomery wrote: > >> >> Hi, >> >> I have used flask/bottle with nginx/uWSGI gevent loop with great success >> for 2.7 >> >> Its now time for me to move on up to

[uWSGI] why will uwsgi not work with python 3.5? plugins/greenlet/greenlet.c:2:31: fatal error: greenlet/greenlet.h: No such file or directory

2017-08-02 Thread David Montgomery
Hi 1) ubuntu 16.04 2) python 3.5.2 3) apt-get install python-dev apt-get install libevent-dev apt-get install python3-greenlet UWSGI_PROFILE="asyncio" pip3 install uwsgi *** uWSGI compiling embedded plugins *** [x86_64-linux-gnu-gcc -pthread] plugins/python/python_plugin.o [x86_64-linux

Re: [uWSGI] why will uwsgi not work with python 3.5? plugins/greenlet/greenlet.c:2:31: fatal error: greenlet/greenlet.h: No such file or directory

2017-08-02 Thread David Montgomery
ps I all installed python3-dev On Wed, Aug 2, 2017 at 3:31 PM, David Montgomery wrote: > > Hi > > 1) ubuntu 16.04 > 2) python 3.5.2 > 3) > > apt-get install python-dev > > apt-get install libevent-dev > apt-get install python3-greenlet > > UWS

Re: [uWSGI] why will uwsgi not work with python 3.5? plugins/greenlet/greenlet.c:2:31: fatal error: greenlet/greenlet.h: No such file or directory

2017-08-02 Thread David Montgomery
never mind - added CFLAGS="-I/usr/local/include/python3.5/" and worked On Wed, Aug 2, 2017 at 4:00 PM, David Montgomery wrote: > ps I all installed python3-dev > > On Wed, Aug 2, 2017 at 3:31 PM, David Montgomery < > davidmontgom...@gmail.com> wrote: > >

[uWSGI] cant get uwsgi to work with nginx and asyncio

2017-08-03 Thread David Montgomery
Why will asyncio and uwsgi work with nginx? 1) I want one process per core 2) here is my nginx server { listen 80; listen [::]:80 ipv6only=on default_server; server_name 127.0.0.1; location = /favicon.ico { log_not_found off; } location / { include uwsgi_params;

[uWSGI] urgent - ValueError: call stack is not deep enough

2018-05-12 Thread David Montgomery
Why is this happing? I had a server die have 8 months and used chef to rebuild and this is how I install uWSGI pip install uwsgi==2.0.15 This is how I start: /usr/local/bin/uwsgi --yaml /var/upload.uwsgi.yaml uwsgi: pidfile: /var/run/upload.pid loop: gevent gevent: 100 carbon: <%

Re: [uWSGI] urgent - ValueError: call stack is not deep enough

2018-05-12 Thread David Montgomery
>>> import gevent >>> print gevent.__version__ 1.3.0 >>> On Sun, May 13, 2018 at 5:17 AM, Etienne Robillard wrote: > Which gevent version are you using? > > Etienne > > > > Le 2018-05-12 à 16:24, David Montgomery a écrit : > > > Why

Re: [uWSGI] urgent - ValueError: call stack is not deep enough

2018-05-12 Thread David Montgomery
I installed 1.2 I guess uwsgi does not like 1.3 Thanks!!! On Sun, May 13, 2018 at 5:21 AM, David Montgomery wrote: > >>> import gevent > > >>> print gevent.__version__ > > 1.3.0 > > >>> > > > On Sun, May 13, 2018 at 5:17 AM,

[uWSGI] unable to load pypy library: libpypy-c.so: cannot open shared object file: No such file or directory

2019-04-06 Thread David Montgomery
I thought uwsgi was supposed out of the box but it does not. This is how I install /opt/pypy3/bin/pip3 install uwsgi==2.0.18 So I was under i build with pypy it will work. Did does not. I even added the below to my yaml file: pypy-lib: /opt/pypy3/bin/libpypy-c.so uwsgi: pidfile: /var/run/<%

[uWSGI] uWSGI will not start

2019-04-06 Thread David Montgomery
Why? I dont get it. Below are the limits I set on ubuntu 18.04 cat /proc/sys/fs/file-max 20 ulimit -Hn 10 ulimit -Sn 10 ulimit unlimited Here is my yaml file: uwsgi: pidfile: /var/run/<%=@server_type%>.pid loop: gevent gevent: 20 socket: 127.0.0.1:8030 processes: <%= node["cpu"

Re: [uWSGI] uWSGI will not start

2019-04-06 Thread David Montgomery
ype%>,LD_LIBRARY_PATH= /opt/pypy3/bin/libpypy-c.so On Sat, Apr 6, 2019 at 7:25 PM David Montgomery wrote: > Why? I dont get it. Below are the limits I set on ubuntu 18.04 > > cat /proc/sys/fs/file-max > 20 > > ulimit -Hn > 10 > > ulimit -Sn > 10 > > u

[uWSGI] why? DAMN ! worker 1 (pid: 10705) died :( trying respawn ...

2019-04-10 Thread David Montgomery
Hi, Why uWSGI? I dont understand. I am trying to run bottle with the gevent loop with pypy2. I mean my code simply works if I run with built in server Here is my entry point in bottle: if __name__ == *"__main__"*: # Interactive mode run(host=*'localhost'*, port=8049,debug=True) #,r

Re: [uWSGI] why? DAMN ! worker 1 (pid: 10705) died :( trying respawn ...

2019-04-10 Thread David Montgomery
ps my works with python 2.7 with gevent loop. If pypy does not work with uWSGI please advice since it appears that gunicon is supported and does not have to setup issues that uWSGI has Thanks On Wed, Apr 10, 2019 at 7:47 PM David Montgomery wrote: > Hi, > > Why uWSGI? I dont under

Re: [uWSGI] why? DAMN ! worker 1 (pid: 10705) died :( trying respawn ...

2019-04-10 Thread David Montgomery
I used gunicorn on the same file with pypy3 and pypy3 . Worked out of the box with the same code. uwsgi with python2.7 works. I am gathering that devs tend to prefer gunicorn for this reason because uwsgi is iffy with pypy On Wed, Apr 10, 2019 at 9:03 PM Mikko Ohtamaa wrote: > > > Why uWSGI?

[uWSGI] uwsgi total fail - --- no python application found, check your startup logs for errors ---

2019-07-06 Thread David Montgomery
Why? --- no python application found, check your startup logs for errors --- Why? I just dont get it. I use bottle and well I start using python app.py it works. Uwsgi clearly does not work. where gunicorn works Well I looked at the logs for errors and I get no means to find out why if __na

[uWSGI] unavailable loop engine !!!

2012-05-11 Thread David Montgomery
Hi, I have installed the following: easy_install greenlet UWSGI_PROFILE=gevent pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz http://gevent.googlecode.com/files/gevent-1.0b2.tar.gz My stack in bottle and nginx. I got my app the work on my local machine but on ec2 Ubuntu..when i

[uWSGI] How to import uwsgi libraries into python

2012-06-13 Thread David Montgomery
Hi, I installed uwsgi using the below on ubuntu. sudo UWSGI_PROFILE=gevent pip install --upgrade http://projects.unbit.it/downloads/uwsgi-lts.tar.gz I go to python and this is what I get. Am I missing something? import uwsgi from uwsgidecorators import * @timer(30, target='spooler') def he

Re: [uWSGI] How to import uwsgi libraries into python

2012-06-13 Thread David Montgomery
I am using bottle as my framework. So, for testing I assume then? Then when I run uwsgi on the socket then all is well? try: from uwsgidecorators import * import uwsgi except: pass On Wed, Jun 13, 2012 at 3:59 PM, Roberto De Ioris wrote: > >> Hi, >> >> I installed uwsgi using the be

Re: [uWSGI] How to import uwsgi libraries into python

2012-06-13 Thread David Montgomery
mode *** spawned uWSGI worker 1 (and the only) (pid: 17020, cores: 500) *** running gevent loop engine [addr:0x4515e0] *** On Wed, Jun 13, 2012 at 4:08 PM, David Montgomery wrote: > I am using bottle as my framework.  So , for testing I assume then? > Then when I run uws

[uWSGI] Simple uwsgi is not working for me

2012-06-13 Thread David Montgomery
Hi, am very new to uWSGI and I am having a terrible time trying to get anything to work. Here is how I installed uwsgi UWSGI_PROFILE=gevent pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz Below is the the command use sudo /usr/local/bin/uwsgi --loop gevent --socket :8030 --ws

Re: [uWSGI] Simple uwsgi is not working for me

2012-06-13 Thread David Montgomery
Wow.thanks.all is working! On Wed, Jun 13, 2012 at 6:33 PM, Roberto De Ioris wrote: > >> Hi, >> >>  am very new to uWSGI and I am having a terrible time trying to get >> anything to work.  Here is how I installed uwsgi  UWSGI_PROFILE=gevent >> pip install http://projects.unbit.it/downloa

[uWSGI] How to get uwsgi to work with nginx - 502 errors with nginx but app works fine

2012-06-13 Thread David Montgomery
Below is the command that I run. sudo /usr/local/bin/uwsgi --loop gevent --http-socket 127.0.0.1:8071 --wsgi-file /home/ubuntu/workspace/uwsgiServer.py --master --async 5 --enable-threads --listen 100 --uid root -b 32768 If I go to 127.0.0.1:8071/mypath all works as expected. I got to 127.0.0.1/

[uWSGI] How to best launch uWSGI with gevent loop

2012-06-14 Thread David Montgomery
Hi, I am coming for tornado to uwsgi. With tornado, I used supervisord to launch a process for each core and used engine nginx as a load balancer. The main reason why I switched is because I have to use redis-py. The tornado and cyclone redis clients, although not blocking are very slow because

Re: [uWSGI] How to best launch uWSGI with gevent loop

2012-06-14 Thread David Montgomery
Thnaks, So, if I have uwsgi listening on 8070 then how to I connect? I assume still using nginx per the below. location / { #uwsgi_connect_timeout 10; include uwsgi_params; uwsgi_pass 127.0.0.1:8070;

[uWSGI] How to use yield for async redis calls using gevent loop

2012-06-15 Thread David Montgomery
Hi, I am tying to best take advantage the gevent loop in uWSGI to make async redis calls using redis-py. Per the uWSGI docs at http://projects.unbit.it/uwsgi/wiki/AsyncSupport """every time the uWSGI server calls yield it stops the execution of the app and accept a new request or resume a previo

Re: [uWSGI] How to use yield for async redis calls using gevent loop

2012-06-16 Thread David Montgomery
Hi Roberto, Thanks for the clarification. Per your explanation of using joinall()...the request will wait and is enough to stop WSGI callable execution. Does that mean other requests will be process? That is, I am now in async mode and therefore non blocking with, in theory, a blocking redis cl

[uWSGI] uwsgi, pyzmq, and the gevent loop

2012-07-01 Thread David Montgomery
Hi, I am using the gevent loop for uWSGI with bottle. I am currently using redis-py to async writes to redis using the below. def RedisWrite(push): r.lpush('global',push) #most recent time user has seen add @get('/') def main(): yield 'Hello World' gevent.spawn(RedisWrite,'Hello World')

Re: [uWSGI] uwsgi, pyzmq, and the gevent loop

2012-07-01 Thread David Montgomery
failed with AssertionError So...am I out of luck using 0mq with uWSGI? can it be resolved? Thanks On Mon, Jul 2, 2012 at 9:52 AM, David Montgomery wrote: > Hi, > > I am using the gevent loop for uWSGI with bottle. I am currently > using redis-py to async writes to redis usin

Re: [uWSGI] uwsgi, pyzmq, and the gevent loop

2012-07-03 Thread David Montgomery
t; fork() > ctx = zmq.ContexT() > scenario (which makes pyzmq useless for logging for me.) > > As for gevent - dont know. I am using pyzmq + pyev + hiredis parser > and custom client. > > Personally i think reporting such an error - is definatly a bug which > should be report

Re: [uWSGI] uwsgi, pyzmq, and the gevent loop

2012-07-03 Thread David Montgomery
used an error: Unhandled exception If I remove mq_send('test') from the loop, I get no errors. On Wed, Jul 4, 2012 at 12:51 PM, David Montgomery wrote: > When I send a message, using the gevent loop, how do I send? > > import uwsgi > def init_mq_ctx(): > glob

Re: [uWSGI] uwsgi, pyzmq, and the gevent loop

2012-07-04 Thread David Montgomery
using the gevent loop in uwsgi. I will try the pub/sub pattern. Thanks for your suggestions on a confusing topic:) On Thu, Jul 5, 2012 at 2:55 AM, Evgeny Turnaev wrote: > 2012/7/4 David Montgomery : >> When I send a message, using the gevent loop, how do I send? >> >>

[uWSGI] ImportError: No module named app

2012-09-11 Thread David Montgomery
Hi, i am trying to get uwsgi to work with flask and proving to be difficult. Why do I get the below? root@localhost:/etc# /usr/local/bin/uwsgi --socket 127.0.0.1:6001 --file /home/ubuntu/workspace/rtbopsConfig/rtbDashboard3/run.py --callable app --processes 4 *** Starting uWSGI 1.2.6 (64bit) on

[uWSGI] Ram and swap grow to full

2012-10-17 Thread David Montgomery
Hi, Below is how I am launching uWSGI via supervisor for the gevent loop /usr/local/bin/uwsgi --loop gevent --socket 127.0.0.1:8070 --processes 3 --pp /home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbUwsgiPixelServer/ --wsgi-file /home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbUwsgiPixelServe

Re: [uWSGI] Ram and swap grow to full

2012-10-18 Thread David Montgomery
Thanks, I did a mem reportt...here is a sample log. {address space usage: 195211264 bytes/186MB} {rss usage: 44097536 bytes/42MB} [pid: 31382|app: 0|req: 372/1286] 74.125.16.81 () {36 vars in 480 bytes} [Thu Oct 18 11:27:51 2012] POST /bidder/ => generated 2 bytes in 3 msecs (HTTP/1.1 200) 1 head

[uWSGI] stats for carbon

2012-10-18 Thread David Montgomery
Hi, I have a hard time find details descriptions for the stats for the carbon options. avg_rt requests rss_size tx vsz_size Thanks ___ uWSGI mailing list uWSGI@lists.unbit.it http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

[uWSGI] IOError: write error

2012-10-19 Thread David Montgomery
Hi, I am seeing the below in the logs. I am trying to understand this but can it be interpreted that I responded to the request in 8ms but its an error not on me but on the client? Basically its not a me problem but a them problem? If the client did not disconnect then I would have had a succes

Re: [uWSGI] IOError: write error

2012-10-19 Thread David Montgomery
I have the carbon flag set for stats. Is there any way I can easily count the time of times this happens so i can shove into graphite? On Fri, Oct 19, 2012 at 5:21 PM, Andriy Kornatskyy wrote: > > uWSGI process handled request but output to pipe (socket), which was closed > by peer, caused this

Re: [uWSGI] IOError: write error

2012-10-19 Thread David Montgomery
Also...I am assuming I can remove from logs using --ignore-sigpipe? On Fri, Oct 19, 2012 at 6:13 PM, David Montgomery wrote: > I have the carbon flag set for stats. Is there any way I can easily > count the time of times this happens so i can shove into graphite? > > On Fri, Oct 1

Re: [uWSGI] IOError: write error

2012-10-19 Thread David Montgomery
Hi, Also, is there a correlation with 499 error codes with the error? I have been trying to figure out the 499 in the nginx acces logs. On Fri, Oct 19, 2012 at 6:14 PM, David Montgomery wrote: > Also...I am assuming I can remove from logs using --ignore-sigpipe? > > On Fri, Oct 19,

Re: [uWSGI] IOError: write error

2012-10-19 Thread David Montgomery
012 19:00:42 +0800 > David Montgomery wrote: > >> Also, is there a correlation with 499 error codes with the error? I >> have been trying to figure out the 499 in the nginx acces logs. > > That exactly the same thing, but seen by nginx rather than uwsgi: >

[uWSGI] *** HARAKIRI ON WORKER 3 (pid: 10133) ***

2012-10-19 Thread David Montgomery
Hi, I enabled harakiri. So...what does that mean? I removed the hari option I got thisi nb the logs. 'hes on core 1199) *** HARAKIRI ON WORKER 3 (pid: 10133) *** *** backtrace of 10133 *** /usr/local/bin/uwsgi(uwsgi_backtrace+0x25) [0x436365] /usr/local/bin/uwsgi(what_i_am_doing+0x27) [0x43649

[uWSGI] uwsgi and High load across the servers.

2012-10-19 Thread David Montgomery
Hi, Below is launch I launch uWSGI. Right now, I have 9 cores doing 1K qps in total..each with 4 gigs of ram. For each requests has two redis reads and two redis writes and I am using gevent for async calls. Agv response time is under 20ms from a post request. In the next few days I will get sl

Re: [uWSGI] uwsgi and High load across the servers.

2012-10-19 Thread David Montgomery
Thanks. I need the other core for another process. I just looked at optimize...set the python optimization level (dangerous) Why dangerous? What does that mean? Yeah...I will disable logging in a bit. I just launched in production and want to see what is going on. I have nginx logs off except

Re: [uWSGI] uwsgi and High load across the servers.

2012-10-19 Thread David Montgomery
Hi, Per the below...thats how I have things set up for nginx. Change to worker_priority -1; in events for at the same level as worker_rlimit_nofile? worker_rlimit_nofile 20; events { worker_connections 3; multi_accept on; use epoll; } Yes..I have three machi

Re: [uWSGI] uwsgi and High load across the servers.

2012-10-19 Thread David Montgomery
See the below. 1 [| 16.1%] Tasks: 62, 7 thr; 4 running 2 [ 22.0%] Load average: 1.86 1.84 1.67 3 [|

[uWSGI] touch reload - How to

2012-10-26 Thread David Montgomery
Hi, I am using supervisor to manage uwsgi. I want to try a touch reload. So... 1) I place the file: touch /tmp/reload.txt 2) What happens of reloaded? does uWSGI delete the file? 3) Here is my command line: command = /usr/local/bin/uwsgi --loop gevent --socket 127.0.0.1:8060 --processes 2

Re: [uWSGI] touch reload - How to

2012-10-27 Thread David Montgomery
So..for the filename, I can use my wsgi file and when its updated from git fetch and the time stamp changes then --boomdome? Reloaded? If true...way cool. On Sat, Oct 27, 2012 at 8:18 PM, Roberto De Ioris wrote: > > Il giorno 27/ott/2012, alle ore 02:43, David Montgomery > h

[uWSGI] uWSG and nice priority

2012-10-27 Thread David Montgomery
Hi, My nginx has a nice priority of -1. I just noticed that uWSGI when I bootstrap my servers start with a nice of 2. What are the optimal nice priority for a dedicated nginx and uWSGI server? I am using Ubuntu 64. Thanks ___ uWSGI mailing list uWSGI

Re: [uWSGI] uWSG and nice priority

2012-10-27 Thread David Montgomery
Hi, I have monit and chef client. I have those set to 2. I have nginx and uwsgi set to -1. Maybee ngnx to -2? On Sun, Oct 28, 2012 at 2:40 PM, Andriy Kornatskyy wrote: > > David, > > The question is generally about contention between various processes and how > kernel schedule them. Givi

[uWSGI] uwsgi_buffering off;

2012-11-06 Thread David Montgomery
Hi, I am using the gevent loop with nginx. All my app does is receive protocol buffers as a post and I respond with a protocol buffer. From the gevent uwsgi docs...should I add uwsgi_buffering off? What are the benifits if I have uwsgi_buffering set to off? stream of data with nginx If you ar

Re: [uWSGI] [ANNOUNCE] uWSGI 1.4-rc1

2012-11-07 Thread David Montgomery
Hi, Awesome. What gevent versions are compatible with uWSGI gevent loop? Currently I an installing using this method on ubuntu 64. I would like to upgrade since any improvement with gevent and non blocking are critical. I do recall an issue with trying to use gevent 1.3. wget http://gevent.go

Re: [uWSGI] [ANNOUNCE] uWSGI 1.4-rc1

2012-11-09 Thread David Montgomery
Hi, My servers are 8 core with 16 gigs. How do I choose the best n for --gevent n --loop gevent Thanks On Wed, Nov 7, 2012 at 11:09 PM, Roberto De Ioris wrote: > > Il giorno 07/nov/2012, alle ore 15:55, David Montgomery < > davidmontgom...@gmail.com> ha scritto: > >

Re: [uWSGI] [ANNOUNCE] uWSGI 1.4-rc1

2012-11-09 Thread David Montgomery
Wow..cool...I am using the graphite plugin. I see two new metrics..busyiness and harikari. What is the best explanation of those two? I am pretty much at 100% on all busyiness on 3 servers with 8 cores each. But I am doing 6K qps. Clearly I need more servers but is rather a black art to tel

Re: [uWSGI] [ANNOUNCE] uWSGI 1.4-rc1

2012-11-09 Thread David Montgomery
PS...I do use once process per core with the gevent loop. I assume that is best practice? On Sat, Nov 10, 2012 at 2:37 AM, David Montgomery wrote: > Wow..cool...I am using the graphite plugin. I see two new > metrics..busyiness and harikari. What is the best explanation of those

[uWSGI] timer does not work

2012-11-22 Thread David Montgomery
Hi, I am using the lastest lts. My timer use to work...now...no. try: from uwsgidecorators import * @timer(60) def load_redis(signum): loadRedisDict() except ImportError: error = str(sys.exc_info()) What am i doing wrong? I am monitoring the logthe timer is not

Re: [uWSGI] timer does not work

2012-11-22 Thread David Montgomery
Does that have to be set? --idle is not set On Fri, Nov 23, 2012 at 4:41 AM, Łukasz Mierzwa wrote: > Do You have --idle option set? > > > 2012/11/22 David Montgomery > >> Hi, >> I am using the lastest lts. >> >> My timer use to work...now...no.

Re: [uWSGI] timer does not work

2012-11-22 Thread David Montgomery
oh.I have harikiri set..at three seconds. would that kill it? On Fri, Nov 23, 2012 at 4:49 AM, David Montgomery wrote: > Does that have to be set? --idle is not set > > > > On Fri, Nov 23, 2012 at 4:41 AM, Łukasz Mierzwa wrote: > >> Do You have --idle option

Re: [uWSGI] timer does not work

2012-11-22 Thread David Montgomery
; also stopped working. But it's not the case since You don't use --idle. > > > 2012/11/22 David Montgomery > >> Does that have to be set? --idle is not set >> >> >> >> On Fri, Nov 23, 2012 at 4:41 AM, Łukasz Mierzwa wrote: >> >>&g

Re: [uWSGI] timer does not work

2012-11-22 Thread David Montgomery
Is this a bug in 1.4 release? Did I miss something in the docs? Is so...I will have to revert back to 1.2.. Thanks On Fri, Nov 23, 2012 at 5:03 AM, David Montgomery wrote: > What is an alternative? Clearly timers are not working for me in uwsgi > using the gevent loop. I need t

[uWSGI] worker id from a gevent loop

2012-12-09 Thread David Montgomery
Hi, I am trying to debug my gevent loop app an am having issues with workers reading data from a dictionary that is updated every 60 from a redis hash. from uwsgidecorators import * @rbtimer(60,target='workers') def load_redis(signum): loadRedisDict() I do believe some worker

[uWSGI] gevent loop leakage

2012-12-30 Thread David Montgomery
Hi, I am using the gevent loop. I am updating a dictionary every 60 seconds. Its a global dict that all workers should read. Content should stop being served if a key is not present. It does work but I see that a tiny about of content is still being sever. If a do a global restart then no con

Re: [uWSGI] gevent loop leakage

2012-12-30 Thread David Montgomery
Hi, See the attached. Note the abrupt stop..thats where I updated the hash. I have 4 servers running one gevent loop per core. So..its clear that the code does what its supposed to do...but I guess there is a runaway worker. I dont know how to explain it. On Sun, Dec 30, 2012 at 7:56 PM, Robe

Re: [uWSGI] gevent loop leakage

2012-12-30 Thread David Montgomery
Hi, Wellthe workers always server requests. Think if is this way. I have a list that random servers pages test=[a,b,c] e.g. random.choice(test). So...randomly, a page will be shown, either a,b,c for eash request. Then I update the list to just show two test=[a,b]. Only a and b should now

[uWSGI] pypy and uwsgi gevent

2013-03-06 Thread David Montgomery
Hi, I currently use the gevent loop using base install of python 2.7 on ubuntu 12.04. I have an app that requires speed. Can I use pypy with the gevent loop? Does this make sense? Its not the async calls that are of issues I just want to speed up the blocking code. Looping though hashes etc..

Re: [uWSGI] [ANNOUNCE] uWSGI 1.9.5

2013-04-04 Thread David Montgomery
Hi, I just installed uwsgi like this: UWSGI_PROFILE=gevent pip install http://projects.unbit.it/downloads/uwsgi-1.9.5.tar.gz I was under the impression that uwsgi shipped with gevent. I launched python and tried to import gevent but cant be found. Was is the recommended gevent version to use wi

[uWSGI] --- no python application found, check your startup logs for errors ---

2013-10-04 Thread David Montgomery
--- no python application found, check your startup logs for errors --- {address space usage: 87171072 bytes/83MB} {rss usage: 17674240 bytes/16MB} [pid: 29393|app: -1|req: -1/11] ddfdf () {40 vars in 663 bytes} [Fri Oct 4 23:33:26 2013] GET /pixel/ => generated 21 bytes in 0 msecs (HTTP/1.1 500)

Re: [uWSGI] --- no python application found, check your startup logs for errors ---

2013-10-04 Thread David Montgomery
taining: > > import bottle > application = bottle.default_app() > > as in http://bottlepy.org/docs/dev/deployment.html#apache-mod-wsgi > uWSGI expects standard WSGI application script that will return > application object. > > > > 2013/10/5 David Montgomery

Re: [uWSGI] --- no python application found, check your startup logs for errors ---

2013-10-04 Thread David Montgomery
So..in sum..if I use localhost..all works..there are no errors in my app. I use uwsgi bottle will not work despite using application = default_app()...and I am geussing an uWSGI issue So..why will uwsgi not work with bottle? Thanks On Sat, Oct 5, 2013 at 9:55 AM, David Montgomery wrote

[uWSGI] invalid request block size: 1229 (max 1024)...skip

2013-10-04 Thread David Montgomery
invalid request block size: 1229 (max 1024)...skip {address space usage: 171003904 bytes/163MB} {rss usage: 24571904 bytes/23MB} [pid: 3653|app: 0|req: 4/6] () {0 vars in 1229 bytes} [Sat Oct 5 04:59:51 2013] => generated 0 bytes in 0 msecs ( 0) 0 headers in 0 bytes (1 switches on core 9) Why

Re: [uWSGI] --- no python application found, check your startup logs for errors ---

2013-10-08 Thread David Montgomery
r your app and put the block of code outside of the conditional > block, like the example for apache mod_wsgi in the doc page referenced by > Lukasz . > > > > On Fri, Oct 4, 2013 at 11:26 PM, David Montgomery < > davidmontgom...@gmail.com> wrote: > >> So..in su

[uWSGI] touch reload now not working

2013-11-15 Thread David Montgomery
Will will touch reload npt work? --touch-reload /home/ubuntu/workspace/devops/servers/pixel_server.py This is hwat i get ins the logs when I run usgi with touch reload unable to load configuration from /home/ubuntu/workspace/devops/servers/pixel_server.py I leave out touch reload the works. Th

[uWSGI] Is my gevent code blocking?

2014-05-22 Thread David Montgomery
Hi, I am using uWSGI 2.0.1 with flask and requests. Is the below code blocking when using the gevent loop? How do I do a yield inf flask? and and can the requests lib be monkey patched? Thanks from gevent import monkey; monkey.patch_all() import gevent import gevent.socket from flask import

[uWSGI] How to log to logstah from the command line

2014-06-01 Thread David Montgomery
logger = socket:127.0.0.1:1717 log-encoder = msgpack map:4|str:message|msg|str:hostname|str:%h|str:version|str:%V|str:appname|str:myapp How would and add the above to the command line rather than wit yaml? Would it be? --logger socket:127.0.0.1:1717 --log-encoder msgpack map:4|str:message|msg|s

Re: [uWSGI] How to log to logstah from the command line

2014-06-01 Thread David Montgomery
sudo /usr/local/bin/uwsgi --pidfile /var/run/api.pid --loop gevent --socket 127.0.0.1:8030 --pythonpath /home/ubuntu/workspace/test-api/app --pythonpath /home/ubuntu/workspace/augno-api --processes 1 --file /home/ubuntu/workspace/test-api/wsgi.py --callable app -b 1024 --master --gevent 10 --enab

Re: [uWSGI] How to log to logstah from the command line

2014-06-01 Thread David Montgomery
How do I do that? This is how I install pip install uwsgi==2.0.1 On Mon, Jun 2, 2014 at 12:06 PM, Roberto De Ioris wrote: > > > sudo /usr/local/bin/uwsgi --pidfile /var/run/api.pid --loop gevent > > --socket 127.0.0.1:8030 --pythonpath /home/ubuntu/workspace/test-api/app > > --pythonpath /

Re: [uWSGI] How to log to logstah from the command line

2014-06-01 Thread David Montgomery
"date":"${strftime:%%d/%%m/%%Y %%H:%%M:%%S}"}' If I run the above..uwsgi does not run and prints the below [log-encoder] registered json {"unix":${unix}, "msg":"${msg}", "date":"${strftime:%%d/%%m/%%Y %%H:%%M:%%S}"}

[uWSGI] messages are showing up in kibana but empty

2014-06-02 Thread David Montgomery
Hi, I am seeing messages in kibana but they values are null. I am using json. This are the messages that I am getting in my logstash shipper: { "message" => "{'unix':, 'msg':'', 'date':''}", "@version" => "1", "@timestamp" => "2014-06-02T20:10:23.431Z", "host" => "1

Re: [uWSGI] messages are showing up in kibana but empty

2014-06-02 Thread David Montgomery
Please disregard. Its working as is. On Tue, Jun 3, 2014 at 4:21 AM, David Montgomery wrote: > Hi, > > I am seeing messages in kibana but they values are null. I am using json. > > This are the messages that I am getting in my logstash shipper: > > { >&quo

[uWSGI] flask and the gevent loop - do i have to yield?

2014-09-02 Thread David Montgomery
from gevent import monkey; monkey.patch_all() from flask import render_template from flask import Response from app import app import urllib2 def fetch_url(url): response = urllib2.urlopen('http://python.org/' html = response.read() @app.route("/test") def test(): jt=gevent.spawn(fetch_

Re: [uWSGI] flask and the gevent loop - do i have to yield?

2014-09-02 Thread David Montgomery
processing does the return block the IO Loop? thanks On Tue, Sep 2, 2014 at 9:51 PM, David Montgomery wrote: > > > from gevent import monkey; monkey.patch_all() > from flask import render_template > from flask import Response > from app import app > import urllib2 > > def fe

Re: [uWSGI] flask and the gevent loop - do i have to yield?

2014-09-02 Thread David Montgomery
But do I still have to yield in the case I want to do post processing after response sent to the client? On Tue, Sep 2, 2014 at 9:56 PM, Roberto De Ioris wrote: > > > Sorry I send the message without finishing. I am confused of the yield > > for > > such a simple example is required for the ge

[uWSGI] Why?

2015-05-27 Thread David Montgomery
Why? UWSGI_PROFILE=gevent pip install uwsgi Traceback (most recent call last): File "/usr/bin/pip", line 9, in load_entry_point('pip==1.5.4', 'console_scripts', 'pip')() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dis

[uWSGI] uwsgi is not working with flask

2015-08-11 Thread David Montgomery
Hi, I cant get uWSGI to work with flask sad to say. Below is my error. Traceback (most recent call last): File "/var/feed-uiserverside/wsgi.py", line 10, in from app import app ImportError: No module named app unable to load app 0 (mountpoint='') (callable not found or import error) *** n

[uWSGI] !! UNABLE to load uWSGI plugin: ./python_plugin.so: cannot open shared object file: No such file or directory !!!

2015-09-29 Thread David Montgomery
Hi, How do I resolve this error? I am on ubuntu 14.04 using python 2x here is how I install: UWSGI_EMBED_PLUGINS=msgpack pip install uwsgi==2.0.5.1 /usr/local/bin/uwsgi --yaml /var/uwsgi.graphite.yaml [uWSGI] getting YAML configuration from /var/uwsgi.graphite.yaml open("./python_plugin.so"): No

[uWSGI] @rbtimer(120,target='workers') kinda works

2015-10-23 Thread David Montgomery
Hi, I am using the gevent loop with python bottle. So every 120 seconds I load data from redis into a python hash. For a sanity check I save the data as a json string every 120 and can verify that the data is updated due to the timer from the saved data I see on disk. However, the worker has to

Re: [uWSGI] @rbtimer(120,target='workers') kinda works

2015-10-23 Thread David Montgomery
lt; riccardo.magliocche...@gmail.com> wrote: > Il 23/10/2015 23:15, David Montgomery ha scritto: > >> Hi, >> >> I am using the gevent loop with python bottle. >> >> So every 120 seconds I load data from redis into a python hash. For a >> sanity >> chec

Re: [uWSGI] @rbtimer(120,target='workers') kinda works

2015-10-23 Thread David Montgomery
OK great thanks I used the global keyword within the function. Thanks!! On Sat, Oct 24, 2015 at 6:18 AM, David Montgomery wrote: > The data in the hash is slowly changing. E.g. 1000 keys in a hash. So > ideally want to load the hash every 5 mins rather than ever call. In > productio

Re: [uWSGI] @rbtimer(120,target='workers') kinda works

2015-10-24 Thread David Montgomery
Thanks. I am definitely looking for a better workflow. But I have to load from redis a key that will turn into a hash every e.g. 5 minutes. I cant load the hash every request. It will be potentially large. So if I dont use rbtimer then within each worker then make a call to redis after so many

[uWSGI] unable to find "application" callable in

2016-03-19 Thread David Montgomery
Hi, If I run flaskj local it works. But the use of uWSGI is not working. I am rather dumbfounded by the below where I get this error unable to find "application" callable in file /var/zenapi/wsgi.py but...the file and app there! Why can it be found? I even added the below to the path per the

[uWSGI] gevent loop does not work with mysql.connector

2016-05-20 Thread David Montgomery
Hi, uWSGI with gevent loop appears to not be working with flask and mysql.connection sad to say. /usr/local/bin/uwsgi --chdir /var/zenapi --pidfile /var/run/api.pid --loop gevent --socket 127.0.0.1:8030 --pythonpath /var/zenapi/app --pythonpath /var/zenapi -- processes 1 --file /var/zenapi/wsgi

[uWSGI] uwsgi python module - now to get fixed id for logging per proccess

2016-06-20 Thread David Montgomery
Hi, I am using both python logging and set_logvar to log extra vars. So for the filename, I would one process per file to be consistent on restarts Kinda like this -> upload-8030-stdout---supervisor-H0_GkI.log In python..how so I get "H0_GkI" portion so I can use it too? then handler = Rotati