It looks like you're new here. If you want to get involved, click one of these buttons!
Hey,
I'm trying to find out what would be more efficient memory wise. Using one PHP-FPM pool for all the websites on the server, or to use a pool per site.
Here is my experience so far...
The first logical thing that came up to my mind, is to use a "pool per site" structure. Because it makes more sense... I tried it on OpenVz. But then I ran out of memory pretty fast. It was before I figured out about the "ulimit -s" thing in OpenVz: http://www.lowendbox.com/blog/reduce-stack-limit-for-multi-thread-apps/
Anyway... I installed my next VPS using only one pool, under "www-data" user. It works fine, however I noticed that the PHP-FPM processes take 2X times more memory in that setup. However, it may be due to having more traffic as well...
The specs for both servers are OpenVz 512Ram with 4 cores.
On which circumstances would you use one-pool-for-all? And when would you use one-pool-per-site?
Thanks.
Comments
I would use one pool per site if I need them separated from each other. For example, if I were letting a couple of other people host their sites on my server, I would give them each a pool under their own user account so that they can't access each other's files.
Unless otherwise specified, opinions posted are my own, not those of any person or company I work for
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksIf you're the administrator of all the sites, go one pool for all. Also look into using ondemand manager, you won't have unneeded PHP processes unless people are accessing the site.
how did this get here i am not good with computer
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksHow does that prevent PHP from accessing other users data?
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksBecause each pool runs under different user with different permissions...
===============================================
Anyway guys. Here is what I found. I hope you'll find it useful...
The best way to make the most out of your LEB, is actually by using as many POOLS as possible.
I repeat...
You should have as many PHP-FPM pools, as possible... I work now in a setup that creates a pool per website. That way, the memory consumption is lower...
Here is what happens. Whenever a PHP process gets a request, it forks itself. Which means it creates a clone of itself.
So if you have 10 websites on the same pool, each PHP process contains cache/data/etc... for all the websites...
Bottom line... My PHP-FPM processes used to weigh 50MB in the RAM. Now their 1MB-2MB.
I hope it helped...
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksI also use one pool per website. Since, each pool runs as the owner of the website, permissions related problems automatically vanish. My LEMP script also does the same.
- Spam
- Abuse
- Troll
0 • Disagree Agree Thanksi use one pool per site
- Spam
- Abuse
- Troll
0 • Disagree Agree Thanks