

TC Slows Hacker News - Start the Arc can't scale rants. - Readmore

It was inevitable now it's time to start the blog posts about how Arc can't scale to the web. ;)
======
immad
The slowness is a self-defense mechanism. Slow down new signups and
submissions.

Its genius really

~~~
wehriam
Arc can heal.

------
pg
At these moderate loads the problem is more likely to be in the design of the
web server than the language itself.

~~~
pg
In fact it was a design flaw, though not in the server.

The code for checking whether a username was taken was inefficient, so it was
taking a huge amount of time to create a new account. The culprit was this
line:

    
    
      (some [is dcuser (downcase _)] (keys hpasswords*))
    

The reason the TechCrunch post slowed the site down so much was not the
traffic per se but the number of those visitors who were creating new
accounts. I pasted a fix into the repl, so the site should be faster now.

Thanks to Rtm for narrowing the problem down to account creation.

~~~
Excedrin
I wish my webserver had a repl.

~~~
nostrademons
Django has a shell that automatically loads all model objects. If you've got a
decent shared-nothing architecture and point your config to the live DB (bad
idea, but for the sake of argument...) that's effectively a REPL for the
webserver.

For that matter, you can get the same effect with the MySQL prompt and a
shared-nothing PHP architecture.

~~~
anewaccountname
>For that matter, you can get the same effect with the MySQL prompt and a
shared-nothing PHP architecture.

I see how you could, say, drop a user from the users table using this; but how
would you fix a login bug like the one under discussion?

~~~
nostrademons

      EXPLAIN SELECT username FROM users WHERE username = $dc_user
    

Then look at the output, and either

    
    
      CREATE INDEX users_username ON users(username)
    

Or cache the result, or do something else to fix the performance problem...

If you meant "How do you find out it was in the registration check?", that's
what the slow query log and query profilers are for...

------
lyime
I was hoping a big blog would NOT post about news.YC I would rather have this
community be small and focused rather then become something like Digg.

~~~
iamdave
This was bound to happen, I'm afraid. If TechCrunch didn't do it, some Digg
kidd would have.

------
TheTarquin
The TC front-paging: A clever Arc stress-test organized by Paul Graham?
Investigative report at 11...

------
mixmax
For a language that was released a month ago I would be surprised if it did
scale.

------
ibsulon
Time to write it in an enterprise language -- I suggest C++.

(Seriously, though, this should give pg and company some valuable benchmarking
data for later on.)

------
thomas
maybe it was just the server?

------
ltbarcly
What about arc makes anyone think it can scale? Is there an example of a
continuations based web server that can?

~~~
mrevelle
Seaside (<http://seaside.st>), which powers dabbledb (<http://dabbledb.com/>).

------
zetaprime
Hacker news was a welcome relief from Reddit and Digg, Reddit is so political
now that there are few articles anymore about "the craft". Aside from the the
prerequisite preachings from the "GREAT!" Paul Graham (amen brothers), there
was some very germaine content at times. I will be curious to see how they
weather the coming storm, of course they do have have an ARC. Lol, I know ver
ver bad pun.

~~~
apathy
programming.reddit is not bad.

But, yeah, if you're a hacker, hacker news is better yet.

