After doing a lot of reading about uWSGI, I've discovered that "uWSGI cores are not CPU cores" (this was confirmed by unbit developers <https://github.com/unbit/uwsgi/issues/233#issuecomment-16456919>, the ones that wrote and mantain uWSGI). This makes me think that the issue I'm experiencing is due to a misconfiguration of uWSGI. But as I'm a developer and not a sysadmin, it's being hard for me to figure out exactly what uWSGI options should I tweak.
I know this is out of the scope of this group, but I'll post my uWSGI app configuration anyway, in case someone still wants to help: [uwsgi] pythonpath = /var/www/medios/ mount = /=wsgihandler:application master = true workers = 40 cpu-affinity = 3 lazy-apps = true harakiri = 60 reload-mercy = 8 max-requests = 4000 no-orphans = true vacuum = true buffer-size = 32768 disable-logging = true ignore-sigpipe = true ignore-write-errors = true listen = 65535 disable-write-exception = true Just to remember, this is running on a machine with 16 CPUs. Maybe I should *enable-threads*, set *processes* options and maybe tweak *cpu-affinity. * My application uses Redis for caching, so I think I can enable threads safely. What do you think? El jueves, 9 de mayo de 2019, 21:10:57 (UTC-3), Lisandro escribió: > > I've checked my app's code once again and I can confirm that it doesn't > create threads. It only uses subprocess.cal() within functions that are > called in the scheduler environment, I understand that's the proper way to > do it because those calls don't run in uwsgi environment. > > In the other hand, I can't disable the master process, I use "lazy-apps" > and "touch-chain-reload" options of uwsgi in order to achieve graceful > reloading, because acordingly to the documentation about graceful > reloading > <https://uwsgi-docs.readthedocs.io/en/latest/articles/TheArtOfGracefulReloading.html> > : > *"All of the described techniques assume a modern (>= 1.4) uWSGI release > with the master process enabled."* > > Graceful reloading allows me to update my app's code and reload uwsgi > workers smoothly, without downtime or errors. What can I do if I can't > disable master process? > > You mentioned the original problem seems to be a locking problem due to > threads. If my app doesn't open threads, where else could be the cause of > the issue? > > The weirdest thing for me is that the timeouts are always on core 0. I > mean, uwsgi runs between 30 and 45 workers over 16 cores, isn't too much of > a coincidence that requests that hang correspond to a few workers always > assigned on core 0? > > > El jueves, 9 de mayo de 2019, 17:10:19 (UTC-3), Leonel Câmara escribió: >> >> Yes I meant stuff exactly like that. >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/b7bf5665-4a2e-4ebd-a147-9f82d2318820%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.