wordpress on fly.io super fast last night, today its got 15s page load times.


I’m really new to fly, but i’m having pretty critical issue already. The title describes majority of the issue. Does anyone know whats going on? I feel like it doens’t make sense to talk about specific setup like memory/cpu etc since nothing has changed since last night in terms of usage or setup. No one is using the wordpress site but me, and the workflow that’s now super slow is just visiting the site.

My Best explanaion for this is that i’m using a fly.io shared CPU and during the day the shared load is much higher than at night.

Is your Wordpress app connect to your MySQL app? I see you have that hosted with us as well.

The MySQL app is using all its available memory. As of about 4-5 hours ago (near the time of your post), there is no free memory available on the instance. This would slow down Wordpress considerably.

I’d try scaling the memory up a bit and see if the situation improves.

fly scale memory 1024 -a your-mysql-app-name

Edit: last 2 days chart of “memory available” metric. This is the memory that can be allocated (sometimes by freeing some other memory).

Thanks @jerome!! I totally assumed that the high memory usage of mysql was something like file cache or mysql cache using any available memory. I’ll scale up memory now!!

1 Like

Looks faster now :slight_smile:

MySQL can be quite memory hungry if you let it. Here are some config options you can use to get the memory use down.

# Performance optimisations
# http://www.tocker.ca/2014/03/10/configuring-mysql-to-use-minimal-memory.html
# https://www.woktron.com/secure/knowledgebase/272/How-to-optimize-MySQL-performance.html
performance_schema = OFF

key_buffer_size = 16M
tmp_table_size = 1M

read_buffer_size = 256K
read_rnd_buffer_size = 1M
net_buffer_length = 2K
sort_buffer_size = 256K
join_buffer_size = 1M

innodb_buffer_pool_size = 8M
innodb_log_buffer_size = 256k
innodb_sort_buffer_size = 125k

max_connections = 25
max_user_connections = 25

table_open_cache = 12
table_open_cache_instances = 1

We are running a complete LAMP stack on a 1GB shared cpu instance. Works really well. You can find our stack here: GitHub - joomlatools/joomlatools-server: Cloud native dev evironment for Joomla CMS, Wordpress and Joomlatools Pages in case you wanna poke around to see it’s config. It’s tailored for Wordpress and Joomla, if you turn MySQL off you get a generic PHP server.



Thanks for the config. i’ll give it a try now. I’m pretty new to mysql but i was feeling like something wasn’t right when mysql needs 1gb of memory to support a 1 page wordpress instance . I’m hoping that 1gb of memory required doesn’t double when i add another page :joy:

1 Like

The config should help you to reduce the memory quite a bit. In my setup i’m running MySQL nominal at 150mb of memory. Should allow you to use a 256 mb instance and if you wanna be on the safe side go for 512mb. For a Wordpress site that should be most sufficient.

To optimise further you can setup query caching. Unfortunatly MySQL dropped it’s query cache for 8.0, MariaDB still offers it.

If you are working with MySQL or PostgreSQL also check out: ReadySet | Same database, (much) faster queries. Especially for low write high read like Wordpress this could give you a significant performance boost. This is bleeding edge, so will need to mature, but my initial test looked very promising.

1 Like