Yes, tuning both MySQL and Nginx can improve performance when memory is low. There are some detailed things to change about MySQL here and Iāve left comments to explain what they do. Note they are almost all trade-offs that use more CPU or Disk I/O to use less memory:
Nginx can also be tuned to deliver more performance and save CPU by example having Nginx serve static files directly or by having Nginx work as cache. Optimizations are often about trade-offs, and saving CPU like that means storing more content cached in memory for fast retrieval. Cloudfareās CDN service could also further reduce CPU through caching.
Docker can be technical and complex to manage. But if are asking if itās a better idea to have four small servers or one big one, having one big one will allow you to share memory and CPU between the instances. That will smoother over some performance problems and likely cost less overall. The trade-off is that if you break the system, all the blogs go down.