[uWSGI] Tip: Get CPU quota under cgroup/docker/k8s for uWSGI

2019-08-04 Thread λq
Hi, Just want to share this snippet. the %k variable gets the number of physical CPU core, but getting CPU quota via cgroup is tricky. [uwsgi] processes = %(@(/sys/fs/cgroup/cpu/cpu.cfs_quota_us) / @(/sys/fs/cgroup/cpu/cpu.cfs_period_us)) chdir = @(exec://realpath %d.. 2>/dev/null || readlink

Re: [uWSGI] example uwsgi protocol using netcat?

2012-10-08 Thread λq
sing shellscript like echo+netcat to test if an uwsgi server is up and running OK? Thanks in advance! λq ___ uWSGI mailing list uWSGI@lists.unbit.it http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Re: [uWSGI] example uwsgi protocol using netcat?

2012-10-09 Thread λq
each individual uwsgi upstream address, and using netcat >> to check that address (either tcp or unix domain socket) >> >> I have difficulty understanding the uwsgi protocol, can anyone give a >> simple example, using shellscript like echo+netcat to test if an uwsgi >> s

[uWSGI] enumerate spool, avoid duplicate spooling

2012-11-19 Thread λq
Hi all, couples of questions for uwsgi spool: 1. Does only 1 spool worker allowed to execute at one time? 2. If a spool task is scheduled to run at a specific time, how do I prevent the task from being scheduled multiple times? (e.g. the web client might submit many times, so a task might be adde

[uWSGI] sendfile SIGPIPE uwsgi

2013-12-02 Thread λq
Hello, I am running nginx + uwsgi 1.9.20 config is look like this: max-requests = 100 enable-threads = true static-offload-to-thread = 3 static-map = /data/=/data/ log-5xx = true log-4xx = true log-slow = true log-big = true log-sendfileg = true log-microsg = true log-x-forwarded-forg = true

[uWSGI] subscription server with --fastcgi-socket

2016-12-29 Thread λq
Hi guys, I was running a single instance uWSGi FastCGI, but later I want to map host names to other uWSGI instances on a remote machine. So I found fastrouter and subscription server. I setup like this master node: uwsgi --fastrouter-subscription-server 0.0.0.0:7500 --fastcgi-socket 0.0.0.0:900

Re: [uWSGI] subscription server with --fastcgi-socket

2016-12-29 Thread λq
CGI is not supported? On Fri, Dec 30, 2016 at 11:41 AM, λq wrote: > Hi guys, > > I was running a single instance uWSGi FastCGI, but later I want to map > host names to other uWSGI instances on a remote machine. > > So I found fastrouter and subscription server. > > I setu

Re: [uWSGI] subscription server with --fastcgi-socket

2016-12-30 Thread λq
Yes! I want a fastrouter speaking fastcgi. Is it possible? I tried an alternative hack, wrap another uWSGI server around it by using Internal routing: uwsgi --fastcgi-socket :9000 --route ".* uwsgi:127.0.0.1:

[uWSGI] --route not working with --fastcgi-socket ?

2017-01-02 Thread λq
Hi guys, uwsgi --http-socket :8080 --route "/ log:hello" This one works by printing a "hello" to the stdout log. uwsgi --fastcgi-socket :9000 --route "/ log:hello" This one doesnt work > --- no python application found, check your startup logs for errors --- How can I make --fastcgi-socket wo

Re: [uWSGI] --route not working with --fastcgi-socket ?

2017-01-03 Thread λq
Thank you Roberto! modifier1 always looks like magic to me. Thank you for the patience! uWSGI can always work it out! On Tue, Jan 3, 2017 at 4:05 PM, Roberto De Ioris wrote: > > > Hi guys, > > > > uwsgi --http-socket :8080 --route "/ log:hello" > > > > This one works by printing a "hello" to t

Re: [uWSGI] --route not working with --fastcgi-socket ?

2017-01-03 Thread λq
> From this example and the previous one you posted it OK let's forget about my previous examples, lets focus on how to use internal router to print "hello" to console when a fastcgi request arrives. > You can instruct the fastcgi parser to force a specific modifier with --fastcgi-modifier1 (wh

Re: [uWSGI] --route not working with --fastcgi-socket ?

2017-01-04 Thread λq
Thank you Roberto. I am dealing with a legacy system which apparently lacks serveral fastcgi_param. It's written in Java fcgi so it's kinda different from nginx. I gradually figured it out, in case anyone else have the same problem like me, you can force add CGI parameters/variables like this:

[uWSGI] Check python code before reload workers?

2017-02-08 Thread λq
Hello, To prevent dumb errors during grace reload, is it possible to abort reloading if the first worker reloads code and encounters an error, so other workers will continue work based on old code? ___ uWSGI mailing list uWSGI@lists.unbit.it http://lists

[uWSGI] uWSGI with Kubernetes CRI (Container Runtime Interface)

2017-02-28 Thread λq
Hi, I recently got interested in K8S, so could we somehow integrate uWSGi with K8S to run like a container? https://github.com/kubernetes/community/blob/master/contributors/design-proposals/container-runtime-interface-v1.md This really looks like uWSGI's own RPC in uwsgi protocl, but with gRPS w

Re: [uWSGI] uWSGI with Kubernetes CRI (Container Runtime Interface)

2017-02-28 Thread λq
> using uWSGI containers features without relying on docker yes, is it possible? >From my (limited) understanding, anything implements some start/stop interface can be orchestrated in Kubernetes. I presume uWSGI already had similar facilities. On Tue, Feb 28, 2017 at 11:13 PM, Roberto De Ioris