Home Node.js Performance Tips from LinkedIn

Node.js Performance Tips from LinkedIn

LinkedIn’s Shravya Garlapati has shared a number of tips for improving performance on their mobile site while using Node.js.

LinkedIn is working with a standard HTML5 mobile site as well as apps for iOS and Android. Previously, LinkedIn has talked about its continuous integration testing for mobile, now they’re sharing some of what they’ve learned.

The Obvious and Not so Much

A couple of the tips are fairly obvious. For example, make sure that you use gzip to compress requests and responses. Don’t use Node.js for static content like stylesheets or images. LinkedIn recommends and uses Nginx for its mobile site.

Another tip that (one hopes) is obvious? “Keep your code small and light.”

But LinkedIn also has a few insights that might not be obvious. For example, Garlapati recommends turning off Node.js socket pooling. “The Node.js http client automatically uses socket pooling: by default, this limits you to 5 sockets per host. While the socket reuse may keep resource growth under control, it will be a serious bottleneck if you need to handle many concurrent requests that all need data from the same host.”

Garlapati also recommends using binary modules with Node.js, and standard V8 JavaScript rather than client-side libraries. “Client-side libraries usually have a lot of inefficient code to overcome browser differences,” says Garlapati. “On the other hand, in Node.js, you know exactly what JavaScript functions are available: the V8 JavaScript engine that powers Node.js implements ECMAScript as specified in ECMA-262, 5th edition. By directly using the standard V8 functions instead of client libraries, you may see significant performance gains.”

Any Node.js tips or tricks that LinkedIn has missed?

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.