Adobe Introduces Powerful Generative AI Tools in Photoshop
Artificial Intelligence

Adobe Introduces Powerful Generative AI Tools in Photoshop Beta

by Veronica
June 1, 2023
2

Adobe Photoshop beta AI will take your creativity to the...

Read more
Adobe Photoshop's Generative Fill Feature

Exploring the Power of Adobe Photoshop’s Generative Fill Feature

June 1, 2023
ChatGPT app

The Easiest Way to Download ChatGPT App Free

June 1, 2023
Nvidia Unveils Futuristic Gaming Experience at Computex 2023

Nvidia Unveils Futuristic Gaming Experience at Computex 2023, Blending Gaming and AI

May 29, 2023
NVIDIA and Microsoft Partner to Accelerate AI

NVIDIA and Microsoft Partner to Accelerate AI

May 25, 2023
How to disable ChatGPT history

How to Disable ChatGPT History and Keep Your Conversations Private

May 13, 2023
AutoML

Automated Machine Learning (AutoML): An Overview

April 7, 2023
Google help me write

Google’s New “Help Me Write” Feature Makes Emailing Faster and Easier

May 16, 2023
Google I/O 2023

A New Update on Google I/O 2023 event

May 12, 2023
ChatGPT Shared Links

ChatGPT Shared Links: A New Way to Share Your Conversations

June 1, 2023
How to use ChatGPT

ChatGPT: A Step-by-Step Guide to Using This Powerful AI Tool

May 15, 2023
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Linux

Best PHP-FPM Configuration – Easy and Simple Calculation

by Cloudbooklet
June 1, 2023
in Linux
Reading Time: 4 mins read
Best PHP-FPM Configuration - Easy and Simple Calculation
Share on FacebookShare on TwitterShare on WhatsAppShare on Telegram

Best PHP-FPM Configuration – Easy and Simple Calculation. PHP-FPM is a FastCGI Process Manager an alternative for PHP. PHP-FPM is highly configurable by adjusting the pool settings easily for different users using different PHP versions and many more.

In this guide you are going to learn the best PHP-FPM configuration method using some simple calculation to prevent some errors listed below.

You might also like

How to Use ChatGPT in Linux Terminal

How to Use ChatGPT in Linux Terminal

May 19, 2023
Install WordPress with Docker Compose, Nginx, Apache with SSL

WordPress Deployment Made Easy: Docker Compose, Nginx, Apache, SSL Setup Guide

May 20, 2023
1. server reached pm.max_children setting, consider raising it
2. seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers)

Step 1: Server Specifications

First, note down your server specifications. Your CPU cores and RAM size.

For example, in this guide let’s assume you have 2vCPU and 16 GB RAM.

Now, determine how much memory you can allot for PHP processing. We can assume around 10GB RAM out of 16 GB RAM we can allot for PHP processing.

Step 2: How much RAM Each PHP-FPM process Consuming

You can execute the following command to check the average memory consumed for the running PHP-FPM processes.

ps -ylC php-fpm7.4 --sort:rss

Replace the PHP version with the one that is used for your application.

You can will get an output similar to the one below.

Screenshot 2022 06 06 at 2.27.29 PM

Take note of the values below the RSS column. This is the memory used by each of your PHP-FPM process.

Here we have about 20MB RAM is used in average by each PHP-FPM child process.

Step 3: Calculate Values for PHP-FPM Children

By default the pm value will be set to dynamic, so you will need to configure the minimum and maximum spare servers and also the maximum children.

We will change the pm value to ondemand to the spare servers will get created automatically according to the demand.

pm = ondemand

Now we can calculate how much child process can be created for the application to run according to the server specifications.

As we are about to allot 10GB RAM for PHP-FPM processing. By executing the command in previous step we found an average value of 20MB consumed by each child.

Maximum RAM can be used by PHP-FPM / RAM consumed by each child = Maximum children value for PHP-FPM

So 10000/20 = 500. You can use upto 500 PHP-FPM children according to your server specifications. So your PHP-FPM configuration should be…

pm.max_children = 500

These are the 2 values that needs to be adjusted for PHP-FPM to run smooth on your server.

You can also configure maximum requests to 500 by just uncommenting the pm.max_requests. This will be useful if there are any memory leaks in any third party libraries.

The final configuration should be like this.

pm = ondemand
pm.max_children = 500
pm.max_requests = 500

Prepare yourself for a role working as an Information Technology Professional with Linux operating system

Conclusion

Now you have learned how to configure PHP-FPM values according to your server specifications with simple calculations.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: PHP
Share7Tweet4SendShare
Cloudbooklet

Cloudbooklet

Help us grow and support our blog! Your contribution can make a real difference in providing valuable content to our readers. Join us in our journey by supporting our blog today!
Buy me a Coffee

Related Posts

How to Install WordPress on Docker

How to Install WordPress on Docker for Windows, macOS, and Linux

May 20, 2023
How to install python on Ubuntu

How to Install Python on Ubuntu 22.04?

May 31, 2023
what's new in node.js 20

What’s new in Node.js 20?

April 23, 2023
AutoGPT in Linux

How to download and install Auto GPT in Linux

May 4, 2023

Comments 4

  1. Flan says:
    12 months ago

    RSS is in bytes, so on average 2 MB of ram is used.

    Reply
    • Jones says:
      7 months ago

      In fact, RSS is in kilobytes, that’s about 200mb per process.

      Reply
      • Sergiu says:
        6 months ago

        The Internet says it’s in bytes.

        Reply
        • LBJ says:
          6 months ago

          Where on the Internet does it say that?

          Jones is correct. From man ps…

          rss RSS resident set size, the non-swapped physical memory that a task has used (in kiloBytes). (alias rssize, rsz).

          Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

  • Trending
  • Comments
  • Latest
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

May 30, 2023
DragGAN AI editing Tool Install and Use DragGAN Photo Editor

DragGAN AI editing Tool Install and Use DragGAN Photo Editor

May 27, 2023
Bard API key

Everything You Need to Know About Google’s Bard API Key

May 20, 2023
Install PHP 8.1 on Ubuntu

How to Install or Upgrade PHP 8.1 on Ubuntu 20.04

May 17, 2023
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

78
Upgrade PHP version to PHP 7.4 on Ubuntu

Upgrade PHP version to PHP 7.4 on Ubuntu

28
Install Odoo 13 on Ubuntu 18.04 with Nginx - Google Cloud

Install Odoo 13 on Ubuntu 18.04 with Nginx – Google Cloud

25
Best Performance WordPress with Google Cloud CDN and Load Balancing

Best Performance WordPress with Google Cloud CDN and Load Balancing

23
Best PHP-FPM Configuration - Easy and Simple Calculation

Best PHP-FPM Configuration – Easy and Simple Calculation

June 1, 2023
ChatGPT Shared Links

ChatGPT Shared Links: A New Way to Share Your Conversations

June 1, 2023
Deepfake

Deepfake: The Rise of Synthetic Media

June 1, 2023
How to Setup SSH Keys on Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

May 31, 2023

Popular Articles

  • DragGAN The AI-Powered Image Editing Tool

    DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

    1506 shares
    Share 602 Tweet 377
  • DragGAN AI editing Tool Install and Use DragGAN Photo Editor

    390 shares
    Share 156 Tweet 98
  • Auto-Photoshop-Stable Diffusion-Plugin: A New Way to Create AI-Generated Images in Photoshop

    71 shares
    Share 28 Tweet 18
  • InternGPT: A New Way to Interact with ChatGPT

    56 shares
    Share 22 Tweet 14
  • Microsoft research Reveals GPT-4 AI Shows Promising Signs of Common Sense and Human-Like Reasoning

    97 shares
    Share 39 Tweet 24
Latest Technology Trends in Artificial Intelligence and Machine Learning with Cloudbooklet

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS

Cloudbooklet © 2023 All rights reserved.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.