Moved PHP sessions to RAM, cut disk IOPS 60%
Just did this on a $5 box where the cheap SSD was the bottleneck, not CPU. Thousands of tiny session file writes per minute were saturating IOPS.
Put sessions on tmpfs:
— tmpfs /var/lib/php/sessions tmpfs size=128M,mode=1733 0 0 in fstab
— matched session.save_path in php.ini
Disk IOPS on the data volume fell ~60% (iostat tps). Login and cart pages stopped stalling under load. Sessions are ephemeral anyway, so losing them on reboot is fine.
Try it tonight.
Root Access Daily
@RootAccessDaily
Moved PHP sessions to RAM, cut disk IOPS 60%
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.