Question

memory consumption on multiple wordpress instance

i want to know, if i install multiple wordpress instance through nginx virtual hosts, will they consume ram individually? or PHP will consume as 1 instance?

for example 4 virtual host

www.example.com - Plain HTML blog.example.com - wordpress support.example.com - wordpress service.example.com - PHP based application

3 out of 4 required PHP. so the PHP consumption will be like 1 central instance or each will eat RAM separately?

also is there any way to have blog.example.com and support.example.com on single wordpress install?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You can do it both ways, where by you have a dedicated instance for each site that uses PHP or one master PHP that spawns children. In your case you are looking to conserve memory usage so you want to have one master process that spawns children as necessary.

The way you define that is by setting each one of your php-fpm pools to be ondemand

pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
pm.max_requests = 200

This will given you one process and spawn as necessary. This will also limit the maximum number of children to 5 and will leave each one spawned for 10 seconds before killing it so that it can serve other requests. Each process will also be terminated when they have either been idle for 10 seconds or if they have processed 200 requests and you can change these variables based on your memory consumption.

The drawback to this is that you will have an initial lag when the first process needs to be spawned, but it doesn’t seem like you are worried about that in this case.

If you want to host the same blog from multiple subdomains you can just set that up in Nginx config:

server_name blog.example.com support.example.com;