How to investigate the 2.95s latency on the very first response from VPS????
My VPS (2 Core, 4 GB RAM, 100 GB HDD) is hosted on a reputed service.
My server has centos 6.5, nginx 1.4.4, php 5.4.23, mysql 5.5.35, wordpress 3.7 with W3 Total Cache. Caching seems to work. Nginx conf enabled Gzip for all media.
When I look through chrome dev tools in network panel, the very first GET request made is getting response in around 2.9 seconds. In other words, time taken for html generation + network travel is 2.9 seconds.
Then starting from the first response, the whole site is getting loaded in next 2.2 seconds - taking the total time to 5.x seconds.
Test php page that queries db and renders the page is having under 70 milliseconds latency in the first step.
Whats the scope for improvement other than increasing CPU cores? Is it possible to tune up the server with some settings or for the amount of given page complexity (theme, etc) this is it and nothing can be done other than hardware addition?
Disk IP perf: DD command results 1.1 GB copied, 3.5 - 6 s, 180 - 300 MB/s
PS: I am aware of other SO questions, most of them recommend some cache plugin, apache mod setting, etc, I am posting this after I have spent enough time digging through them.
xDebug will show you, per script, how much time your server spends executing it http://xdebug.org/docs/profiler
Related
I am extremely sad and couldn't find the solution from last 1 week so I end up asking help here.
I am hosting my business platform on IIS Server running on Windows Server 2021.
I am using server port speed of 10 gb/ps and I have 125 GB ram and 25 cores.
When a user downloads a file from my website, I am getting the server speed of just 100 kbps maximum 500 kbps.
My internet speed is 200 mbps and I am getting the same speed on my PC from the online network speed test.
Please help me to get the highest possible downloading speed on my server, must be I lacking something but I tried all possible things to speedup the server speed.
I am getting this speed in file downloading where I am getting 4-5 mbps when I download anything from google drive-
I have a weird issue on my sites where some images load slow. I have caching in place (CloudFlare caching, Brotli compression enabled), this is referring to the first "uncached" load. All of the images have been compressed to the maximum extent.
I'm wondering why some of the images have such a delay on the first load and if there's anything I can do to fix it.
Here's the network result from a site I didn't have cached.
As you can see, it doesn't seem to matter how large the images are. Some larger ones load faster, while some smaller ones are delayed.
Apache Global Configuration settings are as follows (default):
Start Servers 5
Minimum Spare Servers 5
Maximum Spare Servers 5
Server Limit 256
Max Request Workers 150
Max Connections Per Child 10000
Keep-Alive On
Keep-Alive Timeout 5
Timeout 300
Is there some configuration needed to allow these images to all resolve quickly? The CPU usage when loading my sites (uncached) is minuscule, it never goes over 1%.
In total, I count 17 images (all under 5kb) loading on this particular site.
I understand that Ngix/Litespeed would probably speed up the loading, but this question is strictly related to Apache 2.4+, without either of those installed.
Digital Ocean $20 droplet (2x CPUs - Intel E5-2650 v4, 4gb ram, 80gb ssd).
Apache 2.4+/CentOS/cPanel 90.
Edit: Removing the Apache cache headers and relying on only Cloudflare solved the "random delay". But still the question remains, why does the first "uncached" version take so long to load small images?
I am running a LAMP Stack on a google cloud customized compute engine primarily to host wordpress websites running woocommerce stores.
Following are server specs:
RAM: 5GB, Cores: 1, Space: 30GB, OS: CentOS7, Maria DB Version: 5.5.64, PHP Version: 7.3
Currently facing extreme ttfb Values over 10-20 secs even with very low traffic. Have done the following optimisations for improving the timing but it doesn't seem to improve it. The site has close to 1500 products.
Wordpress caching using hummingbird and auto optimize (minify, GZIP compression etc..) custom .htaccess with header expires, APCU PHP cache, cloudflare CDN, compressed images.
Optimized mariadb with optimum memory allocation, allocated optimum memory to apache and PHP as well.
Tried adding more cores and increase memory of compute engine in vain.
Disabling theme and template has little to no effect.
All the above optimizations has had little effect on the ttfb timings, is this a server/network related issue on my google cloud compute instance ?
Pls check the ttfb values below, test link:
TTFB Test Results
Thanks in advance !
I think you can measure the repose times. Try to measure the time spent waiting for the initial response by going to your browser and clicking "F12" >> "Network" tab and then search for your website using the browser in the same window.
You will get the response times by each process to connect to your website. If you click a specific process and then select the timing you will be able to see the TTFB and with that try to catch where is taking more time.
I believe this is more related with your installations than with the server itself.
If you want to test your server connection you could try to avoid the app side and use a trace or iperf to test your TCP connections times to your server from your local computer (to the external IP), this will only work if you have ICMP traffic allowed.
And the last thing is the same than John mentioned above, check if you're server is not swaping memory or even try to monitor the CPU and mem in use while you run the ttbf test, that will give you an idea if the problem is with the server or with the website and its configuration.
Additionally here are some recommendations to reduce ttbf (https://wp-rocket.me/blog/how-to-reduce-ttfb-wordpress-site/). Hoping it can help some how with this.
Recently, I have an issue with my website from around 6pm gmt and 4am gmt.
I thought at first it was due to visitors at high traffic time but from 0am to 4am I have less visitors than times where the problem doesn't occur. My server gets high CPU usage. Here's the top command screenshot.
I have a dedicated server with 8 cores and 8 GB memory.
You should provide more infos about your issues. That's just a print screen and it's pretty hard to deduct anything based only on that! Check your apache server logs for that specific cPanel user (/usr/local/apache/domlogs/cpanel_user/domain.tld - that's the apache access log file for that account), run as suggested by others SHOW PROCESSLIST in mysql or install a tool like mytop or mtop
I currently have two systems with nginx in the following CPUS/RAM..
1x Intel® C2750 (Avoton), 8 cores 8 threads, #2.4 GHz, 8Gb RAM, 1 TB SATA3
1x Intel® Xeon® E3 1220, 4 cores 4 threads #3.1 GHz, 16Gb RAM, 420 GB 10K RAID 1
Basically I need it to host 6 Wordpress (with a cache plugin) and server a few thousands of files per day.
I'm using free CloudFlare service...
My question is...
Witch server is better for my needs?
Less CPU performance but more cores, or
More CPU performance but less cores?
Best regards,
Well i think for your needs both of them will supply the same performance and this is because of some basic reason's:
you serve a thousands of users per day lets say 10k this is not a massive traffic for your server unless they come in the same second see(DDoS) and for that situation non of them will help you.
CPU in most case's is not the bottleneck of the system setup you didn't mention here the HD those server's have, for example, if they have just regular HardDisk not an SSD both of them will give more or less the same performance.
bottom line, i would choose the cheapest one of those 2 unless money is not an issue.
hope it made your question clear enough.
I think you need choice:
1x Intel® Xeon® E3 1220, 4 cores 4 threads #3.1 GHz, 16Gb RAM, 420 GB 10K RAID 1
16Gb RAM, it is very important for you wordpress cache, because more data can be kept in the cache RAM
a more fast HDD, biggest speed, hight performance for cache
you will not see difference cpu on Wordpress
I'm going to go with the second option:
1x Intel® Xeon® E3 1220, 4 cores 4 threads #3.1 GHz, 16Gb RAM, 420 GB 10K RAID 1
Why?
Faster Hard Drives lead to better website performance, RAID 1 can help deliver this. Also RAID 1 will prevent against Hard Drive failure in case one drive fails.
RAM is essential in hosting environments, you will notice the biggest improvement here if your server comes under load. As your WordPress site will not do a lot of data processing, extra CPU isn't essential; if your server can't keep up CPU processes are just backlogged; though if you reach 75% CPU load, you need to start thinking about upgrading that too.
The Cloud Computing Rant
Of course I will say that old fashioned dedicated servers are the way of the past, CloudFlare in front of dedicated CloudFlare webserver and a dedicated MySQL server would be the best combo (with potentially a load balancer in front of your Nginx server if you ever want to scale them up). Digital Ocean or AWS offer some great cloud computing technology (using more reliable SSDs). Or, even better, use a WordPress PAAS service like WPEngine behind CloudFlare!
The software
I'm glad you're using Nginx over Apache, that will help this out a bit, but make sure your WordPress site is optimised, you could even consider using HHVM in order to speed up the WordPress site further in case you're expecting a lot of load. In short, keep the amount of plugins you use down (for security if anything else). Prevent bruteforce attacks with Fail2Ban, potentially enable NAXSI on Nginx with the dedicated WordPress rules for extra security. Think about enable CSS/HTML/JS minification at a CloudFlare level with aggressive caching, providing it doesn't break your site. Oh, and also think about doing some OPCaching at a PHP level.