Skillz wrote: ↑Sat Feb 18, 2023 6:04 pm
We suspect it's the hardware on the main site.
Hardware on the main site is dual X5690 CPUs, 192GB RAM, and 2TB HDD, Debian 10.
Hardware on the dev site is single E3-1275v2, 32GB RAM and unsure on storage, but Ubuntu 20.04.5 LTS.
Those X5690's are pretty old architechture, but with 2x 6 real cores, and 192Gb RAM on a Linux server they should be OK. And those E3-1275v2's are not that new either, but with fewer cores and less RAM, the dev server should be slower...but it seems faster.
Skillz wrote: ↑Sat Feb 18, 2023 6:04 pm
Main site is hosted in a datacenter in North Carolina w/ 1Gbps up/down
Dev site is hosted at kiska's house somewhere in the land down under (Australia)
For sure not a network limitation.
Agreed.
Skillz wrote: ↑Sat Feb 18, 2023 6:04 pm
I am looking into upgrading the server to much faster hardware (even faster than the dev site) but it'll be a few months before I can save up the money to purchase it.
The main, MAIN, reason for the slow issues is the poor coding the development team did on the site. Basically, every time someone clicks on a page to show the stats it calculates those stats from the database in real time. There is no caching, no index, nothing. What Kiska did was force a "cache" update every minute using a cronjob on the dev site to force the data to stay in the cache, otherwise it only lasts a couple minutes before going away.
The caching sounds to me like the root cause...and having too many users online at once can also slow down page generation if it's pulling data "on demand" from the stats database (rather than the cache).
And you might also be suffering issues with spidering from search engines, which can slow things down as well.
So, maybe some tweaking to the cache might be better than new hardware, especially if the stats are only updated (locally) hourly...the caches do not need to be "constantly" refreshed so often, as long as they are "persistent" and therefore this does not put an extra load on the CPUs to keep refreshing them, if the data is the same?
regards
Tim
(edited last paragraph for better clarity)