Mod_PageSpeed Reports Slow Write Operation on File

Datetime:2016-08-23 01:27:54          Topic: Memcached           Share

I have noticed quite often the following in theapache2log and expressed my concern toQuickhostuk.

[Wed May 11 20:09:03.549759 2016] [pagespeed:error] [pid 25872:tid 139812954580736] [mod_pagespeed 1.9.32.14-0 @25872] Slow write operation on file /var/cache/mod_pagespeed/v2/... ...: 67.025ms; configure SlowFileLatencyUs to change threshold

Reply: Yes yourVPS really is onSSD. It would be MUCH slower if not.

Please also remember that Apache is not the only thing that is trying to use your disk IO. Apache will need to wait for disk IO time while other things are using it such as the OS and all the other software installed on the OS. They all need to wait their turn until the disk is free until they can use it.

You can check your servers disk IO with top , iotop , atop , etc.. commands. You can also ionice your processes so they can use more/less disk IO.

For this reason it is not recommended to use disk for caching, but rather you should use an in memory cache so it uses RAM and not disk. The very link you have provided recommends using memcache or memcached. You can also use Redis or Varnish which are newer. They will use RAM which is much faster than disk.

It just means that a file-cache operation took longer than 50ms. If that happens infrequently — say a few times a day — it’s probably not something I’d worry about. If it happens very frequently — say several times a minute, it means that your disk speed might be slowing down visitors to your site.

One common problem we’ve seen is when file-caches are put onnetwork file systems. If you want to cache on the network it’s much faster to use memcached rather than a file-system. I can’t tell from the message whether “/var/cache” is a local hard disk or is a network mount.

It could be contention with other programs, or a burst of requests to your Apache server. 67ms sounds really slow for an SSD though, so I’m guessing there was CPU contention as well.

The real question is: how often do you see this message? How many times per day?

I hope this helps to clarify that Apache is only 1 of thousands of processes that need to access your disk, but they cannot all access at once so the need to wait their turn. The more things waiting to use your disk the higher %wa in the top command. You can also install systat or sar to keep track of this and show you historical performance.

Also just one more thing to note, If your server needs thebest performance and your sites have become more popular/using more resources then it may be time to upgrade the VPS or also start look at Dedicated Servers. I remember you were asking about Dedicated Servers some time ago.

We do currently have stock: https://www.quickhostuk.com/unmanaged-dedicated-servers/

CPU – 2x INTEL® XEON® E3 (8 CPU Cores)

RAM – 8GB DDR3 ECC

HDD1 – 1x 64GB SSD

HDD2 – 1x 500GB SATA

Bandwidth – 500GB INCLUDED

Remote Reboot – Yes

Price – £49 /m

As per normal we can do 12 months for price of 11 on yearly payment.

–EOF–

GD Star Rating

loading...

653 words




About List