

Ask HN: Has HN been slow/spotty loading for you? - lukeqsee

I love HN. I love it that PG built it himself. It's not easy. I applaud him for it. This isn't a complaint but an inquiry.<p>The last couple days (especially around peak times) HN seems to have slowed dramatically. Pages take multiple seconds (think, 10 to 20) to get served and even the up/down vote images fail to load.<p>Is it just me?
======
smackfu
I've had the images fail to load, as well as the stylesheet (so all the text
comes up as Times New Roman.)

~~~
kindly
I think it may be due to failing dns lookup. It has been for me anyway. The
images and css are on ycombinator.com and not news.ycombinator.com.

------
andreas_bak
It is slow for me as well. It seems that page needs some optimizations in
order to be served and rendered faster when the server is under heavy loads.

1\. I checked responses using FireBug plugin and it seems that pages are
served uncompressed. For example the front page of the site (only html) is 31K
uncompressed, with gzip compression it becomes 6.3K (80% smaller size means
80% less bandwidth to use). Most of web servers support compression.

2\. All pages seem to be generated on every request, e.g. no HTTP cache is
used on server side. Because I did not found any response headers set by
caches. If for example, each page was cached just for 1 to 5 seconds it will
reduce the stress on database and cpu significantly. On the other hand it will
not impact user experience, because cached version is short lived and fresh
results will appear on time. For example the front page is the most requested
page of the site, assume that it is requested 100 times per second which means
100 queries to the database etc. If this page is cached for 1 second queries
and html composition is reduced to 1 time per second. Personally, HTTP caching
on server side is my favorite choice because you don't need to modify the
program to use it. (super-fast Varnish cache is the most flexible solution I
found).

~~~
smackfu
Wouldn't server side caching run into issues since the page is different for
each user? For instance, all the vote up/down buttons seem to have your
username hardcoded into them as the href.

~~~
andreas_bak
Yes you are right. I did not notice it. HTTP cache is effective on resources
that are same for all users.

One possible solution is to decouple the personalized data and load it
separately using AJAX. Votes are already implemented in a similar way.

Generally, I am proponent of HTTP caching. It requires some modifications of
web sites in order to be effective but still the whole system remains less
complicated, compared to implementations of cache on back-end (like
`memcached').

For example reddit, which is similar to HN, is in constant struggle with their
cache subsystems ([http://blog.reddit.com/2010/05/reddits-may-2010-state-of-
ser...](http://blog.reddit.com/2010/05/reddits-may-2010-state-of-
servers.html)). I believe it can be avoided by keeping cache and web site code
apart.

~~~
smackfu
I know rails has the concept of caching HTML snippets, so you still have the
page construction cost, but you avoid the database calls.

------
iuguy
I can't find the HN story, but I seem to remember that PG was rebooting the
server quite regularly. It must be pretty difficult when you're looking at
having to toss up continuing to use the language with it's limitations or
start looking at changes to Arc.

Maybe a front-end cache like nginx would help?

~~~
wwortiz
As stated elsewhere it really seems to be a problem with the static content
hosted on ycombinator.com (maybe they aren't being cached very well browser
side).

I don't know how well something like a front end cache would do to speed up
content delivery as I suspect news.yc has a lot more users logged in than
normal websites which might take away the advantages of a front end cache.

~~~
sudont
Webkit's resource tracker shows that most of the static content is taking
anywhere from 10-14 seconds to be requested, and then loading with a 304 not
modified.

The page, from the news.ycombinator subdomain is loading quick, as is the
tracking code. (180ms latency)

Firefox works the best for me, as it seems to just time out and not request
anything.

------
singer
10 to 20 seconds? That's pretty speedy. I've seen pages take minutes to load.
I've noticed the slowness you speak of for a couple of weeks now.

~~~
lukeqsee
That is slow for the HTML document to be returned (not rendered, but just
returned).

~~~
pig
He is saying that there are HN pages that take minutes to load.

------
alt_
news.ycombinator.com is loading in sub-seconds, but it uses stylesheets and
images hosted on ycombinator.com (a separate server) - which is taking 20s+ to
respond.

~~~
pbogdan
It's been slow for me as well past 1-2 weeks and yes, it's problem with static
files - they take 20-30s to load.

Caching seems to be fine - I'm getting 304s for stylesheets and images (and
they are served from local cache according to firebug and chrome dev. tools)
which means it actually takes 20-30s of wait time for the server to just
return the headers.

I wonder if it might be problem with Keep-Alive which is on (with 15 sec.
timeout I think) - there's probably bunch of apache processes / threads
sitting idle waiting for connections to close and with the amount of traffic
hn gets I would imagine there's quite a few of them.

------
Scott_MacGregor
Yes, I noticed it too.

I don't know what the backend is, but if it's on a single shared machine it
might be too many inquires on the hardware at once. Maybe ask the hosting
company to move it to a machine with a lower load.

~~~
mrduncan
As of 2 years ago, it was hosted on a "3.0 GHz Core whatever, 12 GB RAM,
64-bit FreeBSD 7.1" - it's certainly not a shared machine.
(<http://news.ycombinator.com/item?id=516122>)

rtm is the sysadmin for HN (yes, that rtm:
<http://en.wikipedia.org/wiki/Robert_Tappan_Morris>).

~~~
pyre
IIRC, pg said that ycombinator.com (which is where all of HN's static content
is served from) was on shared hosting.

~~~
mrduncan
It looks like ycombinator.com is hosted by SliceHost
(<http://www.whoishostingthis.com/ycombinator.com>).

------
iamelgringo
It is running slow. YC is doing interviews this week, so PG/RTM are probably
chatting to noob founders instead of looking at HN server stats.

------
scdlbx
I have not had any noticeable problems in the past week.

------
kreek
Pages load fine for me, however submitting a comment is taking longer than
usual.

------
cosmicray
I'm looking at this page in Safari inspector. The only element that took more
than milliseconds to load is prowidget.php (but that may be related to its
size, and my slow ass connection).

inspector has flagged 3 elements with "You could save bandwidth by having your
web server compress this transfer with gzip or zlib": item, news.css and
propres.php

------
calvinf
It took this page about a minute to load for me and the images are still
loading a couple minutes later.

------
static47
Nope I am having the same issues, glad to know it's not just me!.. although it
seems to vary on the time of day.

------
jokermatt999
Yes, and I've checked that it's not the connection or the browser. I'm on XP,
so it's likely not the OS either.

~~~
lukeqsee
I've tried it on OS X with Chrome & Safari + iOS. Same results.

------
SriniK
Are you having issues with iphone/ipad? Sometimes I too have problem with HN
site on my iphone.

------
donniefitz2
Yes, it's been pretty slow lately. The other day it wouldn't load at all for a
brief time.

------
kapitalx
For me it took 1.5 minutes to submit a comment. Lets see how long this one
takes! :)

------
d_c
Definitely slower than usual.

------
mikerg87
reading from iPhone is hit and miss. it seems to tell safari on iphone to use
older page content. iPad at same point in time always seems to get current
stories.

------
abrudtkuhl
Yea definitely slower

------
xentronium
Okay for me, though, I am in GMT+3.

------
Semiapies
It's not just you.

------
sabat
Posting seems slower than it used to be. I'm sure PG is on the case. No
complaints. I'm glad HN exists.

------
EtienneJohnred
If I just answer "yes" without a long dissertation, will I get downvoted by
the elite here? My guess is yes.

