Hi,
I am wondering what is the optimal server configuration for my dedicated server?
I am not having the best hardware, but I notice quite some lag when more then 25 users are on my site.
This is my setup:
Processor2.4 GHz Pentium 4
RAM1 GB
Operating SystemCentos 5.0
I am running Ox on nginx and php-fpm which gives quick results when little visitors are on the site.
Most lag is now caused by high CPU usage, which I would like to optimize more. Looking at the current usage this is what is showing:
top - 11:21:46 up 16:35, 1 user, load average: 83.93, 76.55, 76.65
Tasks: 275 total, 53 running, 208 sleeping, 5 stopped, 9 zombie
Cpu(s): 86.8%us, 12.9%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.3%hi, 0.0%si, 0.0%st
Mem: 1026984k total, 786168k used, 240816k free, 10432k buffers
Swap: 1052248k total, 127244k used, 925004k free, 231264k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22295 apache 16 0 34152 10m 2904 S 31.1 1.1 0:01.99 php-fpm
22170 apache 16 0 45480 21m 2908 R 19.2 2.1 0:02.62 php-fpm
22075 apache 18 0 38508 15m 3080 R 8.9 1.5 0:03.65 php-fpm
11466 mysql 15 0 108m 38m 4056 S 8.0 3.9 3:41.54 mysqld
21529 root 18 0 28708 18m 4276 R 4.6 1.9 0:01.66 python
22083 apache 18 0 31328 8340 3236 R 4.3 0.8 0:11.84 php-fpm
22255 apache 17 0 39084 16m 3216 R 3.6 1.6 0:07.31 php-fpm
22107 apache 18 0 30560 7220 2912 R 1.3 0.7 0:05.94 php-fpm
22345 admin27 20 0 18244 6540 4404 R 1.3 0.6 0:00.04 php-cgi
22332 admin33 17 0 22148 8024 5132 R 1.0 0.8 0:00.06 php-cgi
3144 admin16 15 0 14476 2360 1028 S 0.7 0.2 2:41.45 nginx
22223 apache 18 0 29536 6492 2904 R 0.7 0.6 0:02.02 php-fpm
22290 root 15 0 2552 1188 824 R 0.7 0.1 0:00.15 top
22299 root 15 0 9008 2868 2284 S 0.7 0.3 0:00.09 sshd
1889 root 7 -8 12164 632 560 S 0.3 0.1 0:00.57 audispd
21432 apache 15 0 44968 7180 1596 S 0.3 0.7 0:00.03 httpd
As you can see, most is being caused by php-fpm so I enabled slow-logging for more then 35 seconds.
This is what the log is showing:
[05-Jul-2014 11:21:24] [pool www] pid 22247
script_filename = /home/virtual/ox.merudi.net/var/www/html/ow_cron/run.php
[0xb7f63d38] loadClass() /home/virtual/site16/fst/var/www/html/ow_libraries/wurfl/ClassLoader.php:42
[0xbfd7a350] loadClass() unknown:0
[0xbfd7a530] spl_autoload_call() unknown:0
[0xb7f63b18] unserialize() /home/virtual/site16/fst/var/www/html/ow_libraries/wurfl/FileUtils.php:72
[0xb7f639e0] read() /home/virtual/site16/fst/var/www/html/ow_libraries/wurfl/Storage/File.php:68
[0xb7f63868] load() /home/virtual/site16/fst/var/www/html/ow_libraries/wurfl/UserAgentHandlerChainFactory.php:36
[0xb7f635f0] createFrom() /home/virtual/site16/fst/var/www/html/ow_libraries/wurfl/WURFLManagerFactory.php:149
[0xb7f633fc] init() /home/virtual/site16/fst/var/www/html/ow_libraries/wurfl/WURFLManagerFactory.php:76
[0xb7f632d8] create() /home/virtual/site16/fst/var/www/html/ow_utilities/browser.php:80
[0xb7f62e2c] isSmartphone() /home/virtual/site16/fst/var/www/html/ow_core/ow.php:67
[0xb7f62920] detectContext() /home/virtual/site16/fst/var/www/html/ow_core/ow.php:120
[0xb7f627dc] getApplication() /home/virtual/site16/fst/var/www/html/ow_core/plugin_manager.php:109
[0xb7f62340] initPlugins() /home/virtual/site16/fst/var/www/html/ow_cron/run.php:53
[05-Jul-2014 11:21:24] [pool www] pid 22007
script_filename = /home/virtual/ox.merudi.net/var/www/html/index.php
[0xb7f63e30] autoload() /home/virtual/site16/fst/var/www/html/ow_core/autoload.php:110
[0xbfd7ee40] autoload() unknown:0
[0xbfd7f020] spl_autoload_call() unknown:0
[0xb7f63cfc] setFetchMode() /home/virtual/site16/fst/var/www/html/ow_core/database.php:398
[0xb7f63a04] queryForObject() /home/virtual/site16/fst/var/www/html/ow_core/base_dao.php:114
[0xb7f6388c] findObjectByExample() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/document_dao.php:97
[0xb7f6374c] findStaticDocument() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/navigation_service.php:149
[0xb7f6361c] findStaticDocument() /home/virtual/site16/fst/var/www/html/ow_core/application.php:139
[0xb7f624d0] init() /home/virtual/site16/fst/var/www/html/index.php:43
[05-Jul-2014 11:21:24] [pool www] pid 22135
script_filename = /home/virtual/ox.merudi.net/var/www/html/index.php
[0xb7f64c38] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:331
[0xb7f648ac] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:359
[0xb7f64638] queryForColumn() /home/virtual/site16/fst/var/www/html/ow_core/base_dao.php:101
[0xb7f644f0] countByExample() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/invitation_dao.php:176
[0xb7f64388] findInvitationCount() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/invitation_service.php:84
[0xb7f642d8] findInvitationCount() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/classes/invitation_event_handler.php:131
[0xbfd7ec20] ping() unknown:0
[0xb7f640ec] call_user_func() /home/virtual/site16/fst/var/www/html/ow_core/event_manager.php:193
[0xb7f63bdc] trigger() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/classes/console_event_handler.php:114
[0xbfd7ee90] ping() unknown:0
[0xb7f63a40] call_user_func() /home/virtual/site16/fst/var/www/html/ow_core/event_manager.php:193
[0xb7f63510] trigger() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/controllers/ping.php:17
[0xbfd7f100] index() unknown:0
[0xb7f631ac] invokeArgs() /home/virtual/site16/fst/var/www/html/ow_core/request_handler.php:266
[0xb7f629a0] dispatch() /home/virtual/site16/fst/var/www/html/ow_core/application.php:330
[0xb7f62384] handleRequest() /home/virtual/site16/fst/var/www/html/index.php:65
[05-Jul-2014 11:21:24] [pool www] pid 21720
script_filename = /home/virtual/ox.merudi.net/var/www/html/index.php
[0xb7f64840] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:331
[0xb7f644a4] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:432
[0xb7f64204] queryForObjectList() /home/virtual/site16/fst/var/www/html/ow_core/base_dao.php:126
[0xb7f64080] findAll() /home/virtual/site16/fst/var/www/html/ow_plugins/oaseo/bol/service.php:562
[0xb7f63b64] initUrls() /home/virtual/site16/fst/var/www/html/ow_plugins/oaseo/init.php:108
[0xbfd7f120] oaseo_add_slugs() unknown:0
[0xb7f63a78] call_user_func() /home/virtual/site16/fst/var/www/html/ow_core/event_manager.php:193
[0xb7f634d8] trigger() /home/virtual/site16/fst/var/www/html/ow_core/application.php:148
[0xb7f6238c] init() /home/virtual/site16/fst/var/www/html/index.php:43
[05-Jul-2014 11:23:47] [pool www] pid 22275
script_filename = /home/virtual/ox.merudi.net/var/www/html/index.php
[0xb7f648d4] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:331
[0xb7f64538] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:432
[0xb7f64298] queryForObjectList() /home/virtual/site16/fst/var/www/html/ow_core/base_dao.php:126
[0xb7f64114] findAll() /home/virtual/site16/fst/var/www/html/ow_plugins/oaseo/bol/service.php:562
[0xb7f63bf8] initUrls() /home/virtual/site16/fst/var/www/html/ow_plugins/oaseo/init.php:108
[0xbfd7f120] oaseo_add_slugs() unknown:0
[0xb7f63b0c] call_user_func() /home/virtual/site16/fst/var/www/html/ow_core/event_manager.php:193
[0xb7f6356c] trigger() /home/virtual/site16/fst/var/www/html/ow_core/application.php:148
[0xb7f62420] init() /home/virtual/site16/fst/var/www/html/index.php:43
[05-Jul-2014 11:23:47] [pool www] pid 21472
script_filename = /home/virtual/ox.merudi.net/var/www/html/index.php
[0xb7f6456c] __construct() /home/virtual/site16/fst/var/www/html/ow_core/database.php:187
[0xb7f6412c] __construct() /home/virtual/site16/fst/var/www/html/ow_core/database.php:244
[0xb7f63ea4] getInstance() /home/virtual/site16/fst/var/www/html/ow_core/ow.php:205
[0xb7f63c40] getDbo() /home/virtual/site16/fst/var/www/html/ow_core/base_dao.php:47
[0xb7f63bcc] __construct() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/config_dao.php:66
[0xb7f63b50] __construct() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/config_dao.php:55
[0xb7f63a4c] getInstance() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/config_service.php:63
[0xb7f639d0] __construct() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/bol/config_service.php:52
[0xb7f638cc] getInstance() /home/virtual/site16/fst/var/www/html/ow_core/config.php:48
[0xb7f63830] __construct() /home/virtual/site16/fst/var/www/html/ow_core/config.php:68
[0xb7f6372c] getInstance() /home/virtual/site16/fst/var/www/html/ow_core/ow.php:142
[0xb7f63620] getConfig() /home/virtual/site16/fst/var/www/html/ow_core/application.php:115
[0xb7f624d4] init() /home/virtual/site16/fst/var/www/html/index.php:43
[05-Jul-2014 11:23:47] [pool www] pid 22081
script_filename = /home/virtual/ox.merudi.net/var/www/html/index.php
[0xb7f686d0] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:331
[0xb7f68344] execute() /home/virtual/site16/fst/var/www/html/ow_core/database.php:359
[0xb7f680bc] queryForColumn() /home/virtual/site16/fst/var/www/html/ow_plugins/photo/bol/photo_dao.php:380
[0xb7f67d44] countPhotos() /home/virtual/site16/fst/var/www/html/ow_plugins/photo/bol/photo_service.php:264
[0xb7f67c34] countPhotos() /home/virtual/site16/fst/var/www/html/ow_plugins/photo/components/photo_list_widget.php:70
[0xbfd7f110] __construct() unknown:0
[0xb7f67934] newInstanceArgs() /home/virtual/site16/fst/var/www/html/ow_core/ow.php:439
[0xb7f67728] getClassInstanceArray() /home/virtual/site16/fst/var/www/html/ow_core/ow.php:410
[0xb7f6763c] getClassInstance() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/components/drag_and_drop_item.php:305
[0xb7f67380] renderView() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/components/drag_and_drop_index.php:111
[0xb7f66fe4] tplComponent() /home/virtual/site16/fst/var/www/html/ow_smarty/template_c/cad1746e7fc13ae27a5fd1ad6030c51dcc668f2a.file.drag_and_drop_index.html.php:88
[0xb7f65a8c] content_5389f05e90a7e5_48241312() /home/virtual/site16/fst/var/www/html/ow_libraries/smarty3/sysplugins/smarty_internal_templatebase.php:180
[0xb7f63a4c] fetch() /home/virtual/site16/fst/var/www/html/ow_core/view_renderer.php:101
[0xb7f6396c] renderTemplate() /home/virtual/site16/fst/var/www/html/ow_core/renderable.php:263
[0xb7f634f8] render() /home/virtual/site16/fst/var/www/html/ow_core/component.php:80
[0xb7f6328c] render() /home/virtual/site16/fst/var/www/html/ow_core/renderable.php:250
[0xb7f62e58] render() /home/virtual/site16/fst/var/www/html/ow_system_plugins/base/controllers/component_panel.php:56
[0xb7f62da4] render() /home/virtual/site16/fst/var/www/html/ow_core/request_handler.php:274
[0xb7f62598] dispatch() /home/virtual/site16/fst/var/www/html/ow_core/application.php:330
[0xb7f61f7c] handleRequest() /home/virtual/site16/fst/var/www/html/index.php:65
----
As you can see this doesn't give me much clues where to look for any performance issues.
So I am wondering, what should be the optimal nginx and php-fpm settings to make sure that I get most out of my hardware? I cannot find such information anywhere and I am now messing around with settings, that doesn't seem to help much.
Any help would be appreciated.