1

my server config is

Technology: Ivy Bridge
Processor:  Intel Xeon E3 1245v2
            Intel Smart Cache: 8MB
Cores:  4
Threads:    8
Frequency:  3.4GHz+
Turbo Boost:    3.8GHz
Virtualization: yes
RAM :        32 GB DDR3
Hard drive: Intel SSD 2 x 120GB
RAID:           SOFT - 0/1
                (RAID-1 by default)
NIC:    GigaEthernet
Bandwidth: 200 Mbps guaranteed 
Version:    Parallels Plesk Panel v11.5.30_build115130819.13 os_CentOS 6
OS: CentOS 6.4 (Final)
Server Soft: Apache \ PHP

Now i need to know what i set (Set Max Value which is my server take well) for Nginx

worker_connections (what i set here);
worker_processes (what i set here);

MySql

set-variable=max_connections= (what i set here)
set-variable=max_user_connections= (what i set here)

Any other thanks for mysql,Nginx and any other help me to gate more load pleas tell me i really need help pleas help Thanks

1 Answers1

2

In the end all of these values have to be set according to what you are going to run on your Nginx and MySQL servers, so there is no silver bullet formula to answer your question and be correct in every possible use case. Still I tried to pull some data together that can lead you to the answer for your questions:

Nginx

Regarding Nginx worker_processes the documentation says this:

If Nginx is doing CPU-intensive work such as SSL or gzipping and you have 2 or
more CPUs/cores, then you may set worker_processes to be equal to the number
of CPUs or cores.

If you are serving a lot of static files and the total size of the files is 
bigger than the available memory, then you may increase worker_processes to 
fully utilize disk bandwidth.

Regarding worker_connections, consider this formula that I got from here:

max_clients = worker_processes * worker_connections

So after you know your worker_processes value, you can calculate the worker_connections based on the maximum number of concurrent clients that you might need to serve.

MySQL

Regarding the max_connections value on MySQL you should try to figure out how many connections you will need on your MySQL concurrently at peak time. For example if your application runs on PHP and you have 32 PHP worker processes, and PHP is the only application accessing MySQL, it's probably safe to assume that you won't need more than 32 connections on MySQL. You also don't want to set this value too high, because a whole bunch of buffers has to be allocated for each connection, so if the max_connections value is too high you are taking the risk that something kills your MySQL by creating connections to it until it runs out of memory.

max_user_connections is basically the same thing, just on a per MySQL user base, instead of a global value for the whole MySQL server.

In case you haven't looked at it already, here are the relevant docs:

max_connections / max_user_connections

replay
  • 3,240
  • 14
  • 17