# Gateway Errors and enduring slow performance



## andargor (Jan 31, 2016)

Hey,

For as long as I can remember, myself and other people have indicated that the site performance has been slow. This is a relative measure compared to the other dozens of sites that we are browsing. And before someone puts in doubt my Internet connection, I'm at 100Mbps/10Mbps with pristine latency and no packet loss.

In any case, now things seem to be a lot worse. Half a minute to load a page occasionally, and intermittent 504 Gateway Time-out errors.







Now, I understand that Morrus and his team are busy and EN World is one of the largest sites out there, but can something be done? I suspect the multitude of ads and bits and pieces being pulled from various sites is what is slowing down the page load. I ran a pingdom test, and that is what seems to be the most significant contribution to load time. They say EN World is slower than 80%-94% of all sites measured!

Can we please look at this?

Amsterdam





New York





Australia (sorry was my first test didn't notice the location)


----------



## Morrus (Feb 1, 2016)

We look at it constantly; I use the site too, y'know! 

It's always a constant battle between traffic and resources. [MENTION=52905]darjr[/MENTION] just did some database optimisation and other stuff over the weekend in the hopes that it will help. It looks like we're being slammed with waves of spiders and thousands of spambots trying (unsuccessfully, luckily) to register, but every IP we block means more pop up.


----------



## andargor (Feb 2, 2016)

Hey Morrus, thanks for the explanation.

Why is content.php taking a lot of the time to load?

Also, I can't help but notice a lot of little bits and pieces that add up to load time. May I suggest some of these tips for loading scripts and such using "async" and "defer" to maybe improve perceived load times: https://developers.google.com/speed/docs/insights/BlockingJS


----------



## andargor (Feb 2, 2016)

Woot! Finally able to post! I have another one for you, among the 504's I've been getting tonight:


----------



## darjr (Feb 3, 2016)

found a couple of resource hogs and fixed a couple of things that should relieve some things. More work is needed.

 [MENTION=7231]andargor[/MENTION] please let me know if it's any better.


----------



## andargor (Feb 4, 2016)

Still a bit sluggish, but no 504's or DB errors yet. I'll keep an eye on it for a few days and get back to you. Thanks for the good work


----------



## darjr (Feb 4, 2016)

Working on the sluggish.


----------



## andargor (Feb 7, 2016)

The site does feel a bit more responsive, and I haven't had a Gateway Error since I last reported them. I will do more testing in the evenings (EST North America) to see how things are.

In the meantime, you still have a few load time hogs. This is my latest test from New York: http://tools.pingdom.com/fpt/#!/bPc2D0/http://www.enworld.org/forum/


If you notice on the report (and the image below), there are a few elements with particularly long load times. Without knowing what some of them are used for, may I suggest some solutions:

- All PHP: use HHVM? http://hhvm.com/

- The base URL (which I assume is index.php) :  perhaps think of switching to a static home page that could be published with a cron/scheduled script? That way the database doesn't get hit on every visit, even if the script is run every 5 minutes, or even every minute. E.g. wget/curl http://www.enworld.org/forum/index.php > index.html and have the html first in the load order on nginx? You probably would need to tweak the parameters so that your links work as intended.

- addthis_widget.js : make a copy locally or use a CDN?

- content.php

- combo: looks like it loads remote resource, can they be local?

- 172449.jpg / 171823.jpg / etc.: these are fetched from drivethrurpg.com, can they be local?

- attachment.php :  a whole slew of these, and they really stack up. Can those be images that are statically linked?

- bs.serving-sys.com: no idea

- http://segments.adaptv.advertising.com/: your advertising, should just ensure it does not block load


----------

