I have an instance of EC2 that runs the main LAMP stack as a web server. Users can upload photos through my web application, which is then saved in a directory and written to MySQL. Usually they load as fast as the download speed of Internet users.
Unfortunately, many users report that sometimes downloading photos slows down - up to 2 minutes per photo, and on other sites users can upload much faster.
How can I optimize Apache (I assume it is Apache?) So as not to become a bottleneck? Is it possible to solve this problem with MPM Preforking? Or could it be a database lock problem?
Some additional settings for this setting (this is pretty vanilla):
Instance Type: t2.small EBS-optimized: False PHP v5.4 Server version: Apache/2.4.18 (Amazon)
The only thing that I think is appropriate is that when loading a photo, it was changed using Imagick to the size of the thumbnail (which obviously requires an intensive processor, but usually it is pretty fast).
source share