As mentioned by this tweet, I am interested in accelerating web service.
In this article I accerelated whole structure of WordPress.
This is, I replaced from microSD to USB HDD because read/write speed and durability is better.
I performed benchmark before and after.
You can see where it is.
Other improvements are in this article.
What I did
I just moved files of WordPress/mysql from microSD to USB HDD, that’s it.
services: nginx: volumes: - - ./html:/var/www/html + - /mnt/usb-hdd/wordpress-container/html:/var/www/html wordpress: volumes: - - ./html:/var/www/html + - /mnt/usb-hdd/wordpress-container/html:/var/www/html db: volumes: - - ./mysql:/var/lib/mysql + - /mnt/usb-hdd/wordpress-container/mysql:/var/lib/mysql
Then you can reflect by docker-compose down/up -d.
If contents size is not big, copying all contents from USB HDD to RAM boosts...
Before vs after
I use this article image which runs on Raspberry Pi 4 as “Before”.
I implemented all improvements below.
– Nginx
– PHP
– WordPress
– mysql
I measured with below condition.
- Using LightHouse in Developers Tools of Chrome browser. Checking Performance only - Taking median as representative(n = 5). - Measuring on secret tab of Chrome.
This is my USB HDD.
sudo hdparm -I /dev/sda /dev/sda: ATA device, with non-removable media Model Number: ST1000LM024 HN-M101MBB (snip)
Before
<—Mobile Desktop—>
After
<—Mobile Desktop—>
Mobile improved 8 points, Desktop did 10 points!
But,,, this impact is not as expected because each improvement like Nginx has similar impact.
So this instance should have much more like 30 points more or less…
This is what I did on microSD.
<—Mobile Desktop—>
By moving to USB HDD is better than one of microSD.
I guess caching by each component takes more time than before.
This means actual performance will be better.
Conclusion
How was it?
If you have USB HDD which is not used, you can use it!
Comments