cgbystrom | 15 years ago | on: Why is TCP accept() performance so bad under Xen?
cgbystrom's comments
cgbystrom | 15 years ago | on: Why is TCP accept() performance so bad under Xen?
cgbystrom | 15 years ago | on: Why is TCP accept() performance so bad under Xen?
Thanks for the suggestions, here's some clarifications:
* I clarified what hardware I've tested in a comment (see below).
* I've run tests with my server ranging from 10 sec up to 10 minutes. They're consistently bad unfortunately.
* Interesting what you say about dom0/domU. I'm no Xen guru, but the culprit is probably something like that. I've been using a backlog of 1024 for the server tests (set both in Java land and sysctl.conf). The netperf are all defaults, both in terms of run time and backlog. Was actually trying to monitor the backlog somehow, but I'm not sure that's even possible in Linux?
* The server isn't doing anything disk IO-bound so this shouldn't be the case.
* syncookies seems like a good idea, I will definitely try that along with a lot bigger backlog and see if it makes any difference. I'll also try and see if netperf can be tweaked as well to provide a better, isolated test case.
Writing this off as Xen overhead would be such a shame, virtualization should not cause this much overhead. I'll continue investigating!
cgbystrom | 15 years ago | on: Why is TCP accept() performance so bad under Xen?
* On EC2 I've tried the c1.xlarge and the giant cc1.4xlarge. With cc1.4xlarge, I saw maybe a ~10% increase accept() rate. * Two separate, virtualized servers at the office. * A private, virtualized server on Rackspace was briefly tested as well.
A compilation of netperf results are available at https://gist.github.com/985475
cgbystrom | 15 years ago | on: Electronic Arts is using Erlang
cgbystrom | 15 years ago | on: The Economics of Dropbox
According to them, their storage costs are ~20 times less than those of S3. A bit different use-case for sure. But as wave says, once you become a storage company you will inevitably need to do it in-house to be cost-effective.
cgbystrom | 15 years ago | on: Ask HN: Fastest way to build live chat?
Beaconpush is a good alternative for doing this. We support user presence and you can use the API to find out what users are connected. You can even log out users from the API.
We have a contributed Ruby library (called Dimma) made by one of our users. Don't think it's EventMachine based though. Read more at https://github.com/Burgestrand/Dimma
node.js with socket.io is also a nice alternative. Played with it somewhat myself and I like it! But hosting it yourself will make you deal with scaling, deploying, uptime and hosting in general. Not exactly stuff you want to focus on when developing things on a tight schedule.
So if you're asking me, I'd naturally say Beaconpush (http://beaconpush.com) :)
cgbystrom | 15 years ago | on: Poll: How do you bill recurring payments?
cgbystrom | 15 years ago | on: Poll: How do you bill recurring payments?
Recently been thinking of changing to Chargify now that they support a payment gateway in Scandinavia. We (http://beaconpush.com, push service for Web Sockets) currently have our custom-built system for recurring payments. It works, but I really don't want to spend time hacking on it. I rather be focusing on our core business of developing our service.
cgbystrom | 15 years ago | on: Today, Web Development Sucks
However on some points I'm not as convinced. Take the DOM abstraction, it works and is implemented by several SPA frameworks. You can design good looking, "desktop class" applications pretty fast. But problem arises quickly when your graphic designers send you those PSD mockups, full of great looking artwork waiting to come to life.
With a normal DOM approach you've always been able to solve this. With hacking some HTML, tuning CSS and a lot of swearing you pull through. But with SPA frameworks that favor "components" over low-level, raw DOM elements things usually aren't as straightforward. Very often you need to start picking apart the provided "ready-made components" to get any work done. Ends up being very contra-productive and usually takes way longer to do.
It has happened to me numerous times before with both GWT and Adobe Flex. Nice and shiny, given you don't try changing the layouts too much. Surely, I'd be one happy camper if this wasn't the case, web development need to move forward. And I hope the goals proclaimed by both Cappuccino and Sproutcore will work in practice some day.
Regarding your other point about routing, departing from the route paradigm will be only be true if what your designing is not a document-centric application. In my world, an SPA can be either document-centric or desktop-like (containing a lot of UI state, as you mention). Think the answer to that is the boring "it depends".
Worth mentioning, many of these issues are stuff we've been trying to resolve with the Planet Framework (http://www.planetframework.com), essentially bridging the gap between client and server.
cgbystrom | 15 years ago | on: Facebook Chat Architecture (Erlang)
cgbystrom | 15 years ago | on: Facebook Chat Architecture (Erlang)
But even if that would be solved or if you used something more low-level like, say nginx, you'd still be limited of how fast you can accept().
Try using ApacheBench and hit one server with keep-alive on and off respectively. Even nginx, which I would say is a performant web server, show quite some discrepancies between having to reconnect each time and having a permanent connection.
I file this under the penalty of having to set up and tear down a socket each time. Something that only can be avoided by doing less reconnecting.
I could of course be wrong but these are the findings from doing performance testing and discussing it on the Netty mailing list. But I'd gladly accept suggestions on how to improve this situation for our service.
cgbystrom | 15 years ago | on: Facebook Chat Architecture (Erlang)
I run beaconpush.com which is a cloud-based service for browser push messages. We're based on Netty and Java, which works out well for us. We've looked at Erlang and wrote some initial prototypes in it but Java became our language of choice. Mainly because we knew it and had some experiences with Netty, a NIO library for Java. Netty did also outperform Erlang and mochiweb (both vanilla configured).
Anyway, the problem tend to be with long-poll that users re-establish their connection back to the servers each time they receive a message or navigate to another page (or reload the page). This end up taking a big toll on the system. We're to some extent limited to how fast we can perform accept() on our sockets.
If you use long-polling with multi-part you can get away with sending more messages on a single established connection (it becomes request/response/response/response or similar). That can reduce the system load and the use of WebSockets can eliminate the use of reconnections altogether (disregarding any page reloads).
Facebook's use of AJAX navigation (i.e not reloading the entire page when user clicks on links etc) also reduces this load. This due to not having to re-establish a connection each time a user reloads a page.
So yes, we're actually CPU bound by the accept() behavior (at least to how the JVM does accept()). But would our connection be more permanent in nature then no, we would of course be more I/O bound if not completely.
cgbystrom | 15 years ago | on: Ask Tom Preston-Werner, cofounder of GitHub, anything Today, Mon 18 Oct 2010.
What would you say is the best way to monetize your open-source product?
cgbystrom | 15 years ago | on: SodaJS, functional web testing in NodeJS
Sports both CSS and JavaScript without requiring rendering.
cgbystrom | 15 years ago | on: Ask HN: Review our product Beacon - a hosted Comet push service with WebSockets
1. Right now we offer up to one million messages for free. After that, we charge per each initiated million messages delivered. Meaning, if you send 900 000 you will be charged for 1 MM. Much how Amazon bills hours on EC2.
2. Well, sure. Our endpoint server (where all browsers connect) is written in Java. We're using the Netty framework, which we are incredibly happy with. Highly recommend it for doing high-performance networking in Java. Also, using the JVM instead of, say node.js, makes it very easy to utilize all our CPUs.
The user-facing website is implemented in our own framework called Planet. Developed in-house using Python with focus on real-time web sites. Both Beacon and Planet share the same underlying push technology and we have some major customers using it. You can read more about it at http://www.esn.me
The REST API is also implemented in Python and coordinates the message sending among our end-point servers. It's quite simple actually, just 200 lines of code.
3. Sounds like a good idea. It's just a few lines of code that's needed to integrate it. But yeah, a simple chat app hosted on GitHub would be helpful for newcomers.
-- Carl
cgbystrom | 15 years ago | on: Ask HN: Why choose a dynamically typed language?
cgbystrom | 15 years ago | on: Node and Scaling in the Small vs Scaling in the Large
To me as an outsider, it sounds more as Starling (or Kestrel) got its performance upgraded, not scalability.
May sound pedantic, but it's important to differentiate performance from scalability.
cgbystrom | 15 years ago | on: Node and Scaling in the Small vs Scaling in the Large
cgbystrom | 15 years ago | on: Threaded vs Evented Servers
I tried enabling RPS/RFS, which to my understanding, did this; load balance the interrupt handling among multiple cores. With this enabled, I saw little to no difference in connection rate. But then again I'm guru, I might as well double check this.
Updated my little "action plan" in the original Serverfault question with this info.