my server is not optimize
First allow me to intoduced my self , same problem but different source of problem.
Prologue
We (me and my team/ campus) have a dedicated server placed in our place. we choose WHM as our tools to manage server, and have a little (almost zero) knowledge about how managing a server. Before we use WHM, we rent a hosting to host most of our website. but we concerned about our student data, and decided to build own server.
Part 1 (server spesification)
Total processors: 32Processor #1Vendor Genuine IntelNameIntel(R) Xeon(R) Silver 4110 CPU @ 2.10GHz Speed 2100.000 MHzCache 11264 KB
And Dedicated Connection[COLOR=rgb(184, 49, 47)] 50 Mbps with Mikrotik OS as Router
PART 2 (base on
| Memory Information |
|---|
| [ 0.000000] Memory: 5717008k/35651584k available (7760k kernel code, 2419284k absent, 831520k reserved, 5967k data, 1984k init) |
| System Information |
|---|
| Linux server_name 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 30 14:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
| Physical Disks |
|---|
| [ 4.301984] sd 0:2:0:0: [sda] 2341994496 512-byte logical blocks: (1.19 TB/1.08 TiB) [ 4.302055] sd 0:2:0:0: [sda] Write Protect is off [ 4.302059] sd 0:2:0:0: [sda] Mode Sense: 22 00 00 0b [ 4.302099] sd 0:2:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 4.309591] sda: sda1 sda2 [ 4.311039] sd 0:2:0:0: [sda] Attached SCSI disk [ 10.484707] sd 0:2:0:0: Attached scsi generic sg0 type 0 |
| Current Memory Usage |
|---|
| total used free shared buff/cache available Mem: 32424544 3429240 4857924 428340 24137380 28134456 Swap: 16318460 776 16317684 Total: 48743004 3430016 21175608 |
| Current Disk Usage |
|---|
| Filesystem Size Used Avail Use% Mounted on devtmpfs 16G 0 16G 0% /dev tmpfs 16G 4.0K 16G 1% /dev/shm tmpfs 16G 294M 16G 2% /run tmpfs 16G 0 16G 0% /sys/fs/cgroup /dev/mapper/centos-root 50G 17G 34G 34% / /dev/sda1 1016M 269M 747M 27% /boot /dev/mapper/centos-home 1.1T 139G 911G 14% /home /dev/loop0 2.2G 71M 2.0G 4% /tmp tmpfs 3.1G 0 3.1G 0% /run/user/0 |
-
Due to stuck processes, you are filling up the connection queue in Apache. When this happens, web resources will not be available or will be very slow. This is controlled by the MaxRequestsWorkers value. (You may want to try 1024). If you look in the apache error log, you will see a warning if you are hitting the MaxRequestWorkers value. Why is this happening? The W's are usually due to PHP scripts waiting for something. The something can be difficult to identify but common items are: - Slow MySQL queries.
- Slowly responding APIs.
- Bad PHP loops that require a lot of processing.
1 -
thanks for quick response. i have change MaxRequestsWorkers to 1024. i never pay attention to SS header column before. tomorrow when server get heavy load i will take a note which process have a long timeout. maybe its good decision if i try to limit timeout every app to make sure server wont load too high. are bandwidth still related to my issue? since server try to sending a reply while bandwitdh can handle it? because at early this month we still use 20Mpbs but since 02-16 we have upgrade to 50Mbps yet i cant feel any difference with high server load. server hard to reach only from port 80 or 443. i mean when server on high load all website down. but not WHM. 0 -
You might also want to try running some benchmarking for apache using ab to determine what your needs will be in respect to that. ab - Apache HTTP server benchmarking tool - Apache HTTP Server Version 2.4 When you're seeing the high count of W which indicates= "Sending Reply" are you also experiencing errors in the apache error log or php-fpm specific error logs? If you were low on bandwidth I'd anticipate seeing a high count of "_" rather than "W" and if the timeout was the concern I would anticipate seeing a large amount of connections with "K" 1 -
Bandwidth is not likely an issue. Don't mistake Sending Reply for the server actually sending data. Apache will be in the Sending Reply state as soon as the system processes the request headers and determines what response to send. In this case, you likely have apache waiting on a PHP app to send data. So the server is stuck in the Sending Reply state. Since the issue is due to a slow application, more bandwidth will not help. If bandwidth were the issue, you would see 100% max utilization of your network link. 0 -
in addition to make my application faster, is there any suggestion about my php-fpm setting for php use all available resources to process my application faster? we will make comparison between application run in cpanel (for global access) and local access but still same database. currently in apache status still open just 10 server and child up to 250. even i have update my php-fpm as sugesstion to 1024. 0 -
This ab for all user data with no lib (raw sql) framework lumens by laravel [user@user]# ab -n 500 -c 50 ???????_?????????_????????? Licensed to The Apache Software Foundation, This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, Welcome to The Apache Software Foundation! Benchmarking domain (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Finished 500 requests Server Software: Apache Server Hostname: domain Server Port: 80 Document Path: single_data Document Length: 1559 bytes Concurrency Level: 50 Time taken for tests: 0.283 seconds Complete requests: 500 Failed requests: 0 Total transferred: 877000 bytes HTML transferred: 779500 bytes Requests per second: 1766.40 [#/sec] (mean) Time per request: 28.306 [ms] (mean) Time per request: 0.566 [ms] (mean, across all concurrent requests) Transfer rate: 3025.66 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 1.0 0 5 Processing: 18 24 5.5 23 60 Waiting: 18 24 5.5 23 60 Total: 18 25 6.0 24 63 Percentage of the requests served within a certain time (ms) 50% 24 66% 25 75% 26 80% 27 90% 29 95% 36 98% 46 99% 57 100% 63 (longest request) still benchmarking some function with lib (datatables lib in lumen) With only return 3 row result [user@user]# ab -n 500 -c 50 ???????_?????????_????????? Licensed to The Apache Software Foundation, ???????_?????????_????????? Licensed to The Apache Software Foundation, 0 -
Server Version: Apache/2.4.41 (cPanel) OpenSSL/1.1.1d mod_bwlimited/1.4 Phusion_Passenger/5.3.7 Server MPM: event Server Built: Jan 28 2020 19:40:24 Current Time: Sunday, 01-Mar-2020 23:08:56 WIB Restart Time: Sunday, 01-Mar-2020 21:15:20 WIB Parent Server Config. Generation: 1 Parent Server MPM Generation: 0 Server uptime: 1 hour 53 minutes 36 seconds Server load: 0.21 0.16 0.13 Total accesses: 15949 - Total Traffic: 1.1 GB - Total Duration: 31563742 CPU Usage: u82.62 s18.57 cu0 cs0 - 1.48% CPU load 2.34 requests/sec - 174.0 kB/second - 74.4 kB/request - 1979.04 ms/request 55 requests currently being processed, 120 idle workers Slot PID Stopping Connections Threads Async connections total accepting busy idle writing keep-alive closing 0 202209 no 2 yes 2 23 0 0 0 1 202210 no 3 yes 2 23 0 1 0 2 202211 no 8 yes 6 19 0 0 0 3 202212 no 4 yes 4 21 0 0 0 4 202213 no 12 yes 11 14 0 0 0 5 202487 no 8 yes 15 10 0 0 0 6 203843 no 9 yes 15 10 0 0 0 Sum 7 0 46 55 120 0 1 0 ___________________W__W_____W_________________W________W____W___ W_WW_W__________W________W__W_____W___WW_WW____W___W_W___WWWWWWW W_W___W__WW__W_W_WWWWW___WW_WWWWW___WWWW___WWWW................. .......................................................... Scoreboard Key: "_" Waiting for Connection, "S" Starting up, "R" Reading Request, "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup, "C" Closing connection, "L" Logging, "G" Gracefully finishing, "I" Idle cleanup of worker, "." Open slot with no current process this is my apache status while processing this ab [root@ptik ~]# ab -n 500 -c 50 ???????_?????????_????????? Licensed to The Apache Software Foundation, Welcome to The Apache Software Foundation! Benchmarking domain (be patient) Completed 100 requests Completed 200 requests Completed 300 requests apr_pollset_poll: The timeout specified has expired (70007) Total of 314 requests completed and our server is lag while processing this ab. [root@ptik ~]# ab -n 500 -c 50 ???????_?????????_????????? Licensed to The Apache Software Foundation, Welcome to The Apache Software Foundation! Benchmarking domain (be patient) Completed 100 requests apr_pollset_poll: The timeout specified has expired (70007) Total of 126 requests completed 0
Please sign in to leave a comment.
Comments
7 comments