Bysoft China's Blog > Your e-commerce partner

Share Our Knowledge, Share Our Passion
  • rss
  • Home
  • About Us
  • SERVICES
  • WORKS
  • START ECOMMERCE WEBSITE
  • START CMS WEBSITE
  • CONTACT US

5 simple development tricks for a faster web application

Bysoft | January 30, 2012

Online applications are plagued by low speed : every day, we hear about companies linking slow sales to bad responsiveness of their web site. That constrats with the fact that every single developer has a piece of advice ready on how to make a web site faster and, even, has implemented a way to keep the application running extremely fast.

It is not difficult to keep a web site fast enough : as usual, the most important is to identify the problem as early as possible, during development. Here are 5 simple tricks to spot slow code without much effort.

1. Set max_execution_time, memory_limit and long_query_time very low during development. Ideally, as low as possible : 1s, 32Mb of RAM (http://php.net/manual/en/info.configuration.php) and 1s (http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html), respectively, should be sufficient. Most frameworks are known to eat up (a lot) more than that : then, keep memory 15% above the recommended lower limit. During development, if ever those limits are reached, then there is something worth checking.

Recommendation : check the logs (php error log, mysql slow queries), and look for error on display.

2. Use a slow machine for development server. It is common that the dev server is a strong server : this is conter-productive. The stronger the dev server, the easier it will mask any algorithm shortcoming, which will prove fatal in production. If virtualization is being used, set the processor allocation to low, and much lower than real production server.

Do not mistake this with making the developer`s machine slow : this won’t speed up the web site nor the development.

Recommendation : check the logs (php error log) for time out.

3. Fill the database will a lot of data, even more than expected. If the blog expects one thousand articles, duplicate the database content up to ten thousands. First, this will test drive the import scripts, secondly, this will directly show how the application will perform later in its life. Bad queries and long loops will shows at once with too much data, and will drive you directly to the slow part. Again, low quantity of in-base data tend to mask a slow code.

Recommendation : check the logs (php error log) for time out.

4. Set up traffic load on single pages: use ab (apache benchmark, ) http://httpd.apache.org/docs/2.0/programs/ab.html or http_load (http://acme.com/software/http_load/) to emulate a mob of users hitting a single page : they request a URL and then can make any web site suffer. You can run quick tests with 5, 10 and 30 users : usually, there is no need to go beyond that, and most concurrent problems will spring out of the box at such speeds. Median execution time will give indication about the behavior of the application. It is best to focus on sensitive pages, such as login, homepage, landing page, any special attraction page.

Recommendation : mesure time every day, and keep track of it in an spreadsheet, for easy graphing.

5. Run front office speed check : Yslow (https://addons.mozilla.org/en-US/firefox/addon/yslow/) or alternatives, on the website page, to check how the media are loaded and which is the slowest, or blocking the other, preventing the page to be reactive and fast. Counting the number of elements in the page, the total amount of CSS/Javascript/media/tags will be a good base indicateur, even if rough.

Recommendation : go for A in a limited number of categories.

Any of those tests will be easy to set up, and won’t require much resources to check, and even keep track across development. It will also avoid a large number of awkward situations, where the explanation ends up being : ‘ well, it worked fine in dev…’. For all their roughness, those indicators will also be simple enough to avoid the early optimization, where the code is optimized : as we all know, `premature optimization is the root of all evil`.

Last piece of advice : don’t use them all at the same time, as this will probably way too slow to do any development.

Damien Seguy

Categories
News
Comments rss
Comments rss
Trackback
Trackback

« The Chinese Payment Modules The Chinese Delivery Methods »

One Response to “5 simple development tricks for a faster web application”

  1. fruit mocking party says:
    March 8, 2012 at 08:44

    Hi there! This is kind of off topic but I need some advice from an established blog. Is it tough to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about creating my own but I’m not sure where to start. Do you have any points or suggestions? Cheers

Leave a Reply

Click here to cancel reply.

Recent Posts

  • BBS (Bulletin Board Systems) in China
  • How to buy online in China ? The payment gateway process (end-user perspective)
  • Groupon (Gaopeng) in China and Lashou, its direct competitor
  • Huaban or the Chinese Pinterest
  • Team Member’s interview : Stephanie web project manager
  • The new version 1.12 of Magento Enterprise
  • 2nd China eBusiness Entrepreneurship Conference
  • MD5 is dead : what to use now?
  • The constraints of the Chinese Internet
  • The Chinese Delivery Methods

Categories

  • Content Management (CMS)
  • Ecommerce
  • FAQ Shopmaker – Standard Ecommerce
  • Internet
  • Magento
  • News
  • PHP
  • References
  • Search Engine Marketing (SEM)
  • Search Engine Optimization (SEO)
  • Web Design
  • Web Development
  • Web Technologies
  • Webmarketing

Tags

api asia b2c Baidu business bysoft Bysoftchina c2c china CMS company cpc Design Ecommerce ecommerce navigation education ergonomics eZ publish Google integration interview japan Joomla! lecture Magento open source PHP php engineer ppc press programming sem seo shanghai shopmaker social media symfony tips tutorial web application Webmarketing website cache zend zend framework Zend PHP 5

Recent Comments

  • appeftdormape on Greetings from Bysoft for the Year of the Ox
  • jennera on About Us
  • Boolvehef on The Chinese Delivery Methods
  • New mexico indian beaded bracelets on Bysoft certified engineers
  • Danna on Baidu.com plans to launch an instant messaging service

Pages

  • About Us

Archives

  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • October 2011
  • September 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • June 2009
  • May 2009
  • February 2009
  • January 2009
  • October 2008
  • April 2008
  • March 2008
  • February 2008
  • December 2007
  • November 2007
  • August 2007

Bysoft China

  • Consulting
  • Content Management
  • E-Commerce
  • Graphic Design
  • Magento
  • Marketing Website
  • Programming
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox