Why is my laptop 10x faster than my Linode?

We just got a (second) Linode (8192) about 10-12 days ago. We have a single webserver / application running on this new Linode. It is a ruby application. There are points at which it needs to do some queries and then computational stuff using the query results. I develop this app on an i7 MacBookPro. An operation that takes ~10s on my laptop takes ~90s on the Linode. The performance of my application on the Linode is unacceptably slow from my client's POV. I am really kind of surprised that my laptop is soooo much faster. I'll admit to not knowing much about VPSs and whatnot. Can anyone help me to understand why things are so much slower on the Linode and/or point me towards ideas for possible solutions? I'd like to solve the problem but I'm also interested in learning more about the background that this problem is showing up against.

5 Replies

I've done quite a bit of benchmarking with Rails applications on Linode, and I've found it can be very difficult to get statistically sound results due to a wide range of factors, some of which you can control for and some you can't. There are some steps you can take to reduce the complexity to manageable levels, most of which are best practices anyway. The first is get your laptop set up so the environment your application is running on is as similar as possible to the Linode, which pretty much necessitates using a virtual machine. I use a combination of VirtualBox, Vagrant, and Puppet to achieve this: Vagrant handles creating a VirtualBox VM with the same distro as my Linode, then Puppet installs all the necessary packages and configures things appropriately. The end result is that I can get a VM that's exactly identical software-wise to any of the Linodes I manage by just typing "vagrant up ". If you don't want to go through all the work of writing Puppet manifests for you environment, you can just download a pre-built Vagrant box and configure it manually. In any case, the goal here is to control for as many variables as possible, since otherwise there's way too many confounding factors to deal with.

After that, you'll probably want to use ruby-prof to generate a cachegrind dump of the application so you can see where it spends most of its time, then design benchmarks around that.

mfaughn,

Perhaps you could describe what your application does, what type of calculations, if a database is involved, if you're using caching, what role the VPN plays, etc. All we know is that you have a Ruby application.

MSJ

What's the specs of your laptop for cpu processor and clock speed. If you Ruby work is clock speed sensitive, then I'm pretty sure it would be faster than Linode given then use E5-2680v2 processors which are base clocked at 2.8Ghz, all 8 cpu thread utilisation at Turbo Boost of 3.1Ghz and single core utilisation at 3.6Ghz http://www.cpu-world.com/CPUs/Xeon/Inte … %20v2.html">http://www.cpu-world.com/CPUs/Xeon/Intel-Xeon%20E5-2680%20v2.html

For instance my Samsung ATIV Book 8 laptop uses Core i7 3635QM at 2.4Ghz base and 3.4Ghz Turbo Boost http://www.cpu-world.com/CPUs/Core_i7/I … essor.html">http://www.cpu-world.com/CPUs/Core_i7/Intel-Core%20i7-3635QM%20Mobile%20processor.html so depending on your apps number of cpu core utilisation, your laptop's Turbo Boost speed might be at a clock speed that is higher than Linode's E5-2680v2 processors Turbo Boost clock speed profiles. Not to mention virtualisation overheads associated with Linode Xen virtualisation compared to non-virtualised laptop environment.

Also Linode 8GBVPS only has 6 cpu cores, so your Intel Core i7 based laptop most likely is quad core with HT = 8 cpu threads, so pretty much more cpu threads available than Linode if you are testing with Ruby which is multi-threaded based. If it's single thread based then it's pretty close depending on your laptop's single threaded Turbo Boost clock speed profile compared to Linode's E5-2680v2 single threaded Turbo Boost clock speed of 3.6Ghz.

checking local specs of MacBook Pro with retina display can be configured to

> 2.5GHz quad-core Intel Core i7 processor (Turbo Boost up to 3.7GHz) with 6MB shared L3 cache

Configurable to 2.8GHz quad-core Intel Core i7 (Turbo Boost up to 4.0GHz) with 6MB shared L3 cache.

so yes quite possible you have 8 cpu threads working at Turbo Boost up to 3.7Ghz to 4.0Ghz which would be faster than Linode's 8GB 6 cpu threads at Turbo Boost of 3.6Ghz for single threaded work loads

also MacBook's might be with PCI-E SSD storage which would be faster than Linode's SSD offering so if your work loads touch the disk then can make a difference there too.

Ruby can only utilize a single core at a time. According to the numbers generated by Passmark the Linode's CPU and my rMBP i7 have single-core benchmarks that are pretty close. Order of magnitude difference in speed is what I'm seeing.

App – VPN was a mistake. I meant VPS. No VPN involved. Application uses Ruby Sequel ORM backed by SQLite. App traverses a tree, starting at root, and for example, builds an XML representation of tree. This is simple stuff, get object, parse attribute values into appropriate string, feed XML builder (which is just building a big string). Tree is composed of different types of objects (not that it should really matter). No caching involved.

I do not know what the current breakdown is of how many instances of Linode 8 GBs there are in one actual server, but it's possible that one of your VPS neighbors is consuming a larger amount of resources. Please see my thread here for the experience that I had.

(whoops, just realized this is an older thread)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct