4 ms·
I assume that modern filesystem caching to RAM is incredibly sophisticated, but wouldn't a typical website already be fully served from RAM? If you only have a
by 3eb7988a1663 1y ago
I assume that modern filesystem caching to RAM is incredibly sophisticated, but wouldn't a typical website already be fully served from RAM? If you only have a few megabytes of code + assets, won't the OS see this is hot data, not being updated, so it is no longer being read from disk sometime after the initial read?
- onli 1y agoThe code contains database calls that have to run, reads and writes. Processors are sophisticated, but if they (or rather, they and the os) were that smart, WordPress installations would be a lot faster by default. And maybe that's not surprising, think about it: the typical server does a lot of other things additionally to serving one specific WordPress site.
- handsclean 1y agoA performance problem I’ve run into with small websites like this one is many caching systems are tuned for bigger companies or hotter programs, and basically every load ends up an “exceptional” cold start case. VMs wake up, Cloudflare actually only keeps your data one place, there’s no sane HTTP caching value, and, yeah, files are read from disk. Worse, it’s easy to miss during testing by loading things more frequently. I’m sure there are filesystem or server parameters to tweak, but I do think small websites that want great performance should be, somewhere somehow, managing caching manually.
- pixl97 1y ago> files are read from disk. Disk as in spinning round circles, or disk as in NVMe drive, because there's a pretty massive difference in latency.
- matt_heimer 1y agoIts not the the data is only cached by Cloudflare in one place, its that it is cached at the edge node nearest to the user that last made the request. Geographically different users will likely hit a completely different edge node that needs to hit your origin to populate its cache. Cloudflare has a free tiered caching option that helped my site. Instead of cache missing on local edge nodes always having to hit the origin, the edge node can sometimes pull the data from another Cloudflare server. It reduced load on my origin. Agree with needing to tune and validate caching, one of the biggest changes my PHP site was tuning apc/OPcache sizes.
- r1ch 1y agoCloudflare will actually slow down TTFB for small, less popular sites since they don't maintain a keepalive connection to the origin. This means you pay an additional TCP/TLS setup cost from the Cloudflare POP to the origin which is worse than a direct connection. I also tried testing a smart-placed worker and cloudflared, neither of which seemed to help.
- matt_heimer 1y agoThey can use keepalive but it's likely the small sites are not getting enough traffic on the edge nodes to maintain the connections. You don't think taking a small hit on TTFB is a good trade off for the improved scaling that a CDN offers? Gone are the days that you don't have to worry about bot traffic being a DDOS. An unresponsive site is a lot worse than an extra TCP/TLS setup.
- matt_heimer 1y agoDepends on the amount of data/assets. With all the AI bots its easy for (default) caches to be undersized since sites no longer have most frequently accessed URLs, every URL (and query param combo) ends up being frequently accessed.
- theycallmerick 1y ago[dead]