Intelligent HTTP Request performance boost with Delayed_job

In: Ruby on Rails

24 Mar 2010

After the launch of a recently developed application MYtxtBOX Lite, which allows free sms service online to all mobile networks in Ghana. Do to the nature of the SMS gateway which was the traditional style HTTP post or get request, the application takes a long time to respond to the user since the initial code was manually hitting the SMS gateway with the help of the rio plugin. This made the end user part of the network handshake proccess between application server and the SMS gateway server.

We needed a way to speed this process up and make sure HTTP request is also successful. So we moved the rio process into a Model and added a Delayed_job functionality on Model in the Controller class. This ensures that the end user doesn’t become part of HTTP request process and the HTTP request is added to a queue on the server which is then sent by the delayed_job daemon.

These are the benefits I have had from this approach.

  1. The HTTP Request does not rely on the users internet connection
  2. Only a small amount bandwidth is needed to hit the server and make the queue hence increase in speed
  3. The real HTTP request is made using the online server’s own internet bandwidth which is mega times faster than the home users bandwidth, another performance boost
  4. Using delayed_job the HTTP request is assured of a handshake because it will be resent if there should be any error, eg. 404 error
  5. Makes the application more usable on Limited devices with limited internet speeds

Comment Form

About this blog

Just tackling programming nightmares with flares. Sometimes the tactics are smooth sometimes their rough.

Photostream

About Me

1Alfred is a seasoned programmer with over 8 years of experience, CEO of nCodedev Labs, a Ruby evangelist and activist. Loves programming most of the time, spends my free times with his family or trying out something new. He believes in doing more than expected of you and working hard at anything you find your self working on. As he always says, you don't have to take the bull by its horns all the time, you can take it by the tail too and move on to the horns when you stronger.