Thank you very much Michele for your answer. I understand that assigning different priorities to each web app is a complex problem. I mean, it's "complex" in the sense that it involves many different areas. But I think that with the information I have and the configuration variables I know, I already can do a pretty good aproximation to what I want: - set server.kbytes-per-second in every virtual host - assign a pool_size (in pgbouncer configuration) for the database of every webapp - change the values of minspare and maxspare for the fastcgi process of every webapp
Anyway, my server is still having very little traffic: an average of 5 requests per second, that is, between all the webapps together, so I guess that I can still scale without worrying too much. Well that's it, I won't bother with anymore questions :P Thanks a lot Michele and Niphlod for all the help! Regards, Lisandro. 2014-12-06 4:48 GMT-03:00 Michele Comitini <michele.comit...@gmail.com>: > > > >> I've made this change to one of the apps. I'll be testing with other >> apps in the next days. To get it running I had to import "fcgi_fork" >> from flup.server instead of simple "fcgi". >> >> I know this subject is way away from this group, but I'm tempted to >> ask, given the quality of the info I've received here. If I setup an >> app with more minspare and maxspare children than other, ¿would this >> mean that the app will have more resources assigned than the other >> app? >> >> This is a question that I'm asking since a while: how do I limit the >> server resources used by every app (that is, accordingly to the "plan" >> every client has paid for his app). I've already limited network >> bandwidth for every app, and recently I was able to limit the >> connections to the database for every app. >> >> So, if I assign more spare children to an app, ¿would it be that the >> app is being assigned with more CPU? >> > > I would say no unless you have a number of CPU >= total number of possible > processes from all app. > That would be a really large server! > minspare, maxspare are two bounds that you need to shape based on the > physical resources at disposal and the need to make the app responsive. > Spares stay idle but ready to answer to new requests, the more you have the > better is responsiveness under variable loads. But idle processes consume > memory, while running processes also consume CPU time. If you have 4 cores, > you will have no more than 4 processes running in any unit of time. The > O.S. kernel will try to manage all the processes requesting to run by > assigning them to a CPU, by various criteria, the fact is that each time the > CPU has to switch from one process to another (context switching) it has to > do a lot of work. So having too many processes in the run queue compared to > the number of CPUs, makes the system waste much of it's time in context > switching. > To assign different priorities to each application, minspare, maxspare are > only a little part of a complex problem. Lighttpd can help by managing the > network traffic across applications, the Linux (BSD too!) kernel has many > options, to enforce limits and priorities on resource usage to a single or a > group processes. > The literature about this is overwhelming :-) > > > > -- > 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 a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/5RTO_RqCsus/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.