Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-18 Thread Theron Luhn
One thing not yet explicitly mentioned on this thread: the recommendation is one *concern* per container, not necessarily one OS process. As Hynek said, that a single-worker gunicorn container is actually two processes is an uninteresting implementation detail. The number of OS processes is

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-18 Thread Hynek Schlawack
> - I also do 1 proc/Docker image, I would recommend to have a look on > https://pythonspeed.com/docker/ for various things to keep in mind if you > haven’t seen it already. > > I am very familiar with the trade offs and tuning of process vs. threads. > Now, when this conversation is going

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-18 Thread Jonathan Vanasco
On Monday, September 16, 2019 at 8:37:17 PM UTC-4, hynek wrote: - HAProxy kicks nginx’s and Apache’s behinds in almost every regard. This > is my hill. I like my hill. I will retire on this hill. > I really like HAProxy and Varnish. They were both keystones to some high traffic sites I

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-18 Thread Mikko Ohtamaa
- I also do 1 proc/Docker image, I would recommend to have a look on > https://pythonspeed.com/docker/ for various things to keep in mind if you > haven’t seen it already. > I am very familiar with the trade offs and tuning of process vs. threads. Now, when this conversation is going on, would

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-18 Thread Jonathan Vanasco
On Wednesday, September 18, 2019 at 1:34:57 AM UTC-4, hynek wrote: > > > This means "recycle after 4096 +/- 128 requests” (The jitter is so they > don’t recycle all at once; although it’s unlikely to happen at the same > time over the whole cluster. The option is more useful when you have more

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Hynek Schlawack
That’s a good point, I should’ve added more nuance to it. Generally speaking I think the average developer doesn’t have to care for it if they don’t serve an excessive amount of huge static files. Make sure to serve everything that’s not part of app from a CDN, set aggressive caching headers,

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Hynek Schlawack
> On 17. Sep 2019, at 21:25, Jonathan Vanasco wrote: > - I don’t know whether it’s me, my Python DB driver (sqlanydb ), or the > underlying libs: there’s stuff leaking all the time so I wouldn’t use a WSGI > container that doesn’t do worker recycling after a configurable amount of >

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Hynek Schlawack
> On 17. Sep 2019, at 22:13, Alexander Mills > wrote: > > @hynek you are not using 1 process per container. Eh, yes it’s true that I run actually two: the gunicorn master and one child process as worker. Conceptually I think of it as one, because only one process of my app is running at a

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Bert JW Regeer
Unless you are using a version of sendfile that does TLS in the kernel, most of the benefits of sendfile disappear as soon as you enable TLS. All of the encryption is done in userspace and you can't use sendfile for that. Even if you use sendfile to send it to a reverse proxy, at some point it

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Alexander Mills
@hynek you are not using 1 process per container. You are using gunicorn or haproxy instead of the container and those talk to python? On Tue, Sep 17, 2019 at 12:25 PM Jonathan Vanasco wrote: > > > On Monday, September 16, 2019 at 8:37:17 PM UTC-4, hynek wrote: > > >> - I don’t know whether

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Jonathan Vanasco
On Monday, September 16, 2019 at 8:37:17 PM UTC-4, hynek wrote: > - I don’t know whether it’s me, my Python DB driver (sqlanydb ), or the > underlying libs: there’s stuff leaking all the time so I wouldn’t use a > WSGI container that doesn’t do worker recycling after a configurable amount

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Mike Orr
On Tue, Sep 17, 2019 at 1:42 AM Julien Cigar wrote: > > On Sun, Sep 15, 2019 at 11:22:40AM -0700, Mike Orr wrote: > > On Thu, Sep 12, 2019 at 2:13 PM Mikko Ohtamaa > > wrote: > > > > > > > > >For static assets and such - they should not be served from WSGI in the > > >first place and you can

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-17 Thread Julien Cigar
On Sun, Sep 15, 2019 at 11:22:40AM -0700, Mike Orr wrote: > On Thu, Sep 12, 2019 at 2:13 PM Mikko Ohtamaa wrote: > > > > > >For static assets and such - they should not be served from WSGI in the > >first place and you can nicely offload this to CloudFlare or similar > >automatically . > >

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-16 Thread Hynek Schlawack
Since I saw a few replies that I don’t entirely agree with, let me give you a bunch of different opinions: - I also do 1 proc/Docker image, I would recommend to have a look on https://pythonspeed.com/docker/ for various things to keep in mind if you haven’t seen it already. - As others

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-15 Thread Theron Luhn
> On Sep 15, 2019, at 11:22 AM, Mike Orr wrote: > > What if they're access-restricted to certain groups of users? I have > my public assets served by Apache (via 'ProxyPass /staic !' and 'Alias > /static /directory') but I serve private ones with 'FilerResponse'. Nginx can authenticate

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-15 Thread Mike Orr
On Sun, Sep 15, 2019 at 11:34 AM Mike Orr wrote: > Regarding performance, I usually use Waitress but I hvae one > application that's higher-volume than the others and it bogged down in > stress tests but when we switched it to uWSGI the problems went away. > The downside is uWSGI is C so it's

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-15 Thread Mike Orr
On Sat, Sep 14, 2019 at 12:24 AM Bert JW Regeer wrote: > There's upsides and downsides to all of them. Pre-fork is great if you want > to save some memory and have the ability to kill processes in the future, > prefork + threaded allows you to handle many requests with a single forked > child,

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-15 Thread Mike Orr
On Thu, Sep 12, 2019 at 2:13 PM Mikko Ohtamaa wrote: > > >For static assets and such - they should not be served from WSGI in the first >place and you can nicely offload this to CloudFlare or similar automatically . What if they're access-restricted to certain groups of users? I have my public

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-14 Thread Alexander Mills
We used to have Apache + 4 python processes using mod_wsgi in a Docker container. The experience was subpar. Too much crap in one container. So we moved to the single proc per container idea, so one python process per container running bjoern..We just have more containers, instead of more procs

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-14 Thread Bert JW Regeer
Yeah, I've seen them. I don't care about them. Here's why: https://github.com/omedhabib/WSGI_Benchmarks/blob/master/src/app.py This is an unrealistic of a test as it can get. It does 0 I/O other than accepting a

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-12 Thread Mikko Ohtamaa
> * I've found a forking server like uwsgi / gunicorn to be the most > performant strategy for most situations, as their "max_requests" settings > to restart workers will eliminate most issues with process growth or memory > leaks. they both also offer numerous deployment and management benefits

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-12 Thread Jonathan Vanasco
On Thursday, September 12, 2019 at 1:54:53 PM UTC-4, Theron Luhn wrote: > > Usually you put an HTTP server like nginx or HAProxy in front of your WSGI > server, which are very good at handling high-volume HTTP requests, so that > your WSGI server isn't subjected to whatever the internet might

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-12 Thread Theron Luhn
Also, a note on those performance benchmarks: They’re testing absurd numbers of simultaneous connections. That might not be the most relevant metric. Usually you put an HTTP server like nginx or HAProxy in front of your WSGI server, which are very good at handling high-volume HTTP requests,

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-12 Thread Theron Luhn
It looks like bjoern is only single threaded, so can’t process concurrent requests, and has no configuration besides host and port. I wouldn’t sacrifice features for the sake of performance unless I had a compelling reason to. The WSGI server is rarely a bottleneck. You’ve been using

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-12 Thread Alexander Mills
Thanks Bert, have you seen the results: https://www.appdynamics.com/blog/engineering/a-performance-analysis-of-python-wsgi-servers-part-2/ bjoern seems to be much more performant than the alternatives. -alex -- You received this message because you are subscribed to the Google Groups

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-11 Thread Bert JW Regeer
The answer is: it depends You can run whatever you'd like. I run waitress in production in a docker setup. But you can also use uWSGI for example to run your production, or gunicorn, or a large variety of other choices. What were you running before? Bert > On Sep 11, 2019, at 11:49,

Re: [pylons-discuss] most performant way to run WSGI app as single process

2019-09-11 Thread Alexander Mills
So yeah I hear that bjoern is good? https://www.appdynamics.com/blog/engineering/a-performance-analysis-of-python-wsgi-servers-part-2/ https://github.com/jonashaag/bjoern anyone have anything good/bad to say about bjoern? -alex On Wed, Sep 11, 2019 at 2:27 PM Alexander Mills wrote: > We are

[pylons-discuss] most performant way to run WSGI app as single process

2019-09-11 Thread Alexander Mills
We are trying to adhere to philosophy of one process per Docker container. So instead of Apache + 4 Python procs in a container, we just want 1 python proc per container. I am new to WSGI apps. My question is - what is the most performant native python server which can run a WSGI app like