IRCTC improved, finally !

Status
Not open for further replies.

Hrishi

******************
What's the problem? A poor will earn his bread and butter standing in the queue... Instead they should not allow any queue before a certain time in the morning...
It's a big problem. A big one , indeed.
There are other ways too to earn bread and butter.
 

whitestar_999

Super Moderator
Staff member
[MENTION=121890]kaz[/MENTION],that's exploiting the poor.imagine a genuine hard working person,need to make a tatkal booking,standing in queue for hours while another person with more money simply hiring a poor person to stand in queue for him while he sits comfortably at home.does this sound fair to you?
 
Read them again. To queue means to go one by one where the first gets served first and last gets served last, not people stacking behind each other.

I suggested to "club" the online booking services and the tatkal ticket counters in stations through a unified token system. Not to eliminate the e-booking service.
 
OP
dashing.sujay

dashing.sujay

Moving
Staff member
Wow, mission accomplished. Bought a tatkal ticket by 10:05am. And probably I was the last one to get the ticket as there was a single ticket remaining when the payment stage had reached. IRCTC does seem to be improved by leaps and bounds.
Read this thread in the morning, told my Dad to lets give a try. We don't have anything to lose.
I don't usually use IRCTC to book tatkal except when its on some low traffic route and is off-season. The main reason being that the tickets gets over by 10:05 or maximum 10:10 in the routes that I need to travel and the queue is not so long in the counter inside the campus(except days like today - holidays+ counselling) and IRCTC doesn't budge until 11am.

You unlocked a new achievement ;)

Today, morning only me and my Dad were discussing on how to get a ticket, as here the queue for tatkal seem to start 2 days before only! That is to book on 6th, you need to stand in the queue from 4th night only. :eek:

This is unbelievable. How long is the queue ? And what do you mean by 2-3 days of travel (in your next post)?
 

TheSloth

The Slowest One
Read them again. To queue means to go one by one where the first gets served first and last gets served last, not people stacking behind each other.

I suggested to "club" the online booking services and the tatkal ticket counters in stations through a unified token system. Not to eliminate the e-booking service.

I didn't get you. So people who book online also have to go and get tokens?
 
Leave it, not worth my time to explain it in detail.
Guy A prebooks ticket online at 10:00 > get token #30
Guy B prebooks ticket from station at 10:01 > gets token #31
For all tickets available, lower tokens are allocated tickets. For all cancelled tickets, lower tokens are allocated tickets.
(what if both at 10:00? Server concurrency will handle it)

p.s. once again, token means something that is given in place as assurance to something else. Not the tokens you punch out to get in queue at a bank.
 

kaz

right here
It's a big problem. A big one , indeed.
There are other ways too to earn bread and butter.

:shock:

- - - Updated - - -

[MENTION=121890]kaz[/MENTION],that's exploiting the poor.imagine a genuine hard working person,need to make a tatkal booking,standing in queue for hours while another person with more money simply hiring a poor person to stand in queue for him while he sits comfortably at home.does this sound fair to you?

Yeah right :)
 

Vignesh B

Youngling
This is unbelievable. How long is the queue ? And what do you mean by 2-3 days of travel (in your next post)?
Usually this happens only during this season and during the winter term break.
Here, in the counter only 1 staff is present, and usually 90% of queue consists of students going back home. Poor them, they lie on the road outside as the counter closes at 8pm outside. Fortunately,the counter is present on a dead end of the campus. Till last year, during the holiday season, people used to write down their names on a piece of paper a day or two before the date of booking and hand it over to the security guard at the counter and come around 8am on the day of booking. But this year some of the staff and students made a furore saying that it is injustice to the people staying overnight at the counter.
Buying from the counter present at the station is a no-no for most staffs and students as usually the queue is crowded by those illegal agents and other people standing for their respective bosses. Rarely will you find a legitimate traveler there. Also the place is utterly filthy.
Most of my travel by train include going to Kerala or Tamil Nadu, which takes around 46-48 hours. Add to that the 5 hours from Roorkee to Delhi.
 

Vyom

The Power of x480
Staff member
Admin
Well I would like to quote a reply from Quora on IRCTC. This was written by Dhananjay Sathe, and I take no credit.

Dhananjay Sathe, Platform Developer & Operations Engineer @Directi

Thanks for the A2A Akhil

Contrary to popular belief IRCTC is perhaps a compounded problem.

Sheer volumes and complexity

  • They are the biggest E-Commerce Site in the country, about 2x the nett sales of Flipkart.com the next name on that list AFAIK. The sort of demand they see in the peak tatkal booking hours I suspect is orders of magnitude higher than what flipkart can handle. For instance something as small (relatively) as the recent Moto-E launch in India took down flipkart infrastructure ( Flipkart server crashes as Motorola Moto E goes on sale ).
  • Over 8 billion trips per year are undertaken in Indian Railways and bulk of the booking happens through this system. Even on a record-breaking day, Amazon only sold 13.5 million items worldwide, whereas Indian Railways on the whole sells more than 21 million tickets on any average day. The electronic system was put in place in the 80s and has since received multiple incremental updates.

  • Of these, IRCTC books around 250 million tickets per annum. It operates just the outermost web layer. So, while webserver configurations, website architecture, and other improvements will play a role, problems with booking a ticket are spread across every layer up to the database. Moreover, the failures at each stage of booking compound because a person who failed at the last step will start afresh right from log in.
  • The problem is not just the insufficiently responsive ticketing interface, but the huge demand-supply ratio. Even if the whole process was totally seamless, we would’ve only ensured that the first 20 million or so people got their tickets every day, but 3 times as many people will still be left without a reservation.

Bottlenecks and solutions

Technical -

Seat selection

  • Also the railway system is far more complex then say a straight forward purchase from amazon or a Google search.Tickets are commodities, while seats and berths are not! This adds to the complexity. Let’s say Amazon had an inventory of a million toothbrushes and 2 million people try to buy the same item. I’m assuming they’ll just need to decrement the counter and complete the transaction with buyers on a first-come first-served basis, without worrying about which exact toothbrush will go to whom (at the time of sale). In contrast, Indian Railways offers a precisely labelled berth or seat to a ticket buyer.
  • In database terms, a row-level lock is obtained on the berth, while thousands of transactions compete for that! A better way would be to sell tickets first and allot the berths later. If passengers can handle the sophistication, they can even do a check-in later, but I think we’re still quite some time away from that. The current logic for berth preference can be retained, but applied as a separate step. In reservation centres, there can be a separate berth allotment counter for confirmed ticket holders.
  • This could use a stateful precompute algorithm that generates the next candidate seat and provides it dynamically. Then generates the next one as a background async process.
Payments

  • Another huge bottleneck is in processing payments. It involves a series of menu selections by users each causing pages to load followed by complex handshakes between IRCTC, third party gateways, and the banks, security checks and so on. Each step is prone to failures too. On the whole, 29% of attempted payments failed.
  • Why not deduct money before ticket booking begins for the day and return it if booking is unsuccessful? Actually, IRCTC is instead considering a smarter move by which passengers can keep prepaid cash with them. Apart from the obvious performance improvement, the economic implications are huge. Imagine crores of rupees lying with them without a need to pay interest? Already, Indian Railways benefits from having an Advance Reservation Period of 4 months. Together, effectively, passenger money is deposited several months in advance. Remember Dell?
  • Possibly they could have credit cards on file . Google Play, Itunes and many others already do this, your next ticket could be a couple of clicks away, EVEN ON MOBILE !
Database

  • It becomes apparent a lot of this is to do with their database architecture they perhaps could implement a beefier database cluster with ample replication and sharding. A lot of the work is read bound and this could most certainly be improved.
  • If the database and application layers are appropriately coupled it should be possible to implement some sort of active caching, thus minimising rapid read impact without losing out on data validity.
  • A lot of the sporadic load comes around the tatkal tickets. This is a tiny fraction of the huge data open to booking. A good architecture would be to to shard this critical hot data into highly optimised database that would be tuned for concurrent locks and writes and offer high availability for read throughputs. Also tune your application to handle this separately optimised for the job at hand. Use beefy hardware for the same (plenty of ram,cpu network bandwidth etc)

Application Design and Architecture


  • Toss out the monolithic web app and validation system
  • USING A CMS for this scale is (IRCTC uses BroadVision’s CMS) an epic fail
  • Ditch the Windows Stack , Move to Unix based environments, enable Gzip compression , use stuff like Flashcache, HA-Proxy, Docker dynamic scaling deployments depending on the time of the day. For instance add 5x the power during peak. Use a combination of Cloud on demand and self hosted infra for best results.
  • Remove banner adverts, they as the railways should not need this , keep a clean minimal interface that does the job.
  • Move the session handling into another layer and should be much more graceful. The load of the 10 min timeout in a mainloop for instance is perhaps one of the main reason for many screwups.
  • Break up critical parts into modules that are designed to scale horizontally provided the right hardware.
  • CDN for static content with multi host and redundant bandwidth across locations in the country,
  • Revamp the core api to be data driven, off load client logic into the web browser using something like Backbone or Angular - this achieves 2 things, api can be rigorously tested and hardened. Ui can be offloaded to another team that specializes in it , get better UI , easier to extend and open up possibilities for a much better api driven mobile client
Hardware & Networking


  • Update the database cluster for sure and most of the architecture that can no longer support these workloads.

  • Add edge points in all major cities and aptly geo located centres to minimise the response time (this would need a decoupled app imho for best results)
  • Sorry EC2 is no magic word like a lot of people suggest , EC2 would be a poor choice for IRCTC given where their traffic and business is based off.
  • Perhap at certain time use a Cloud hybrid deployment, you can use the elasticity of the cloud to meet peak requirements that are sporadic. If the demand is consistently at similar levels, add new physical hardware to your DC not to the cloud.
  • Add an Peakflow/Arbor and handle DDOS mitigation abilities as i suspect the railways site is victim to plenty given their importance. I would choose a device over other techniques as the 2x latencies introduced to mitigators/scrubbing centers (none in India) would just kill the purpose.
  • Dedicated redundant Bandwidth from multiple ISP , possible multihost.They always seem to choke on this, besides DDoS mitigation requires plenty of it. They are a sizable organization and should be able to get that from govt and non govt players


NON TECHNICAL

Yes IRCTC is at the end of the day a public sector body, here are some of the usual suspects

  • Bureaucracy in every step - delays getting the required people, hardware and technical expertise to fix the issue once and for all
  • Lack of political will to fix the irctc system to create a bias for the chap at the counter .
  • Possible corruption that benefits from a bad IRCTC experience such as the network of travel operators and agents with political connections/lobbies to ensure they stay in business.
  • Lack of funds
  • The top down culture could have put some people averse to change and ones lacking the technical inclination required so this may not feature on their priority list or could be fooled by the software vendor into sub standard software CMS running on a windows stack ;)

This awesome article by Sundar Lakshmanan was the inspiration to the answer.Five things IRCTC ticketing site must fix: A geek's wishlist for IRCTC/Indian Railways - NextBigWhat. It got me thinking as to how this issue can be resolved and come up with the numerous ideas. Feel free to suggest and add more , perhaps a sort of answer wiki.

Link to the original reply: *www.quora.com/Indian-Railways/What...C-website-to-be-so-slow-and-unpleasant-to-use

And hence, any kind of reform IRCTC does is appreciated.
 

anirbandd

Conversation Architect
Well I would like to quote a reply from Quora on IRCTC. This was written by Dhananjay Sathe, and I take no credit.

Dhananjay Sathe, Platform Developer & Operations Engineer @Directi

Thanks for the A2A Akhil

Contrary to popular belief IRCTC is perhaps a compounded problem.

Sheer volumes and complexity

  • They are the biggest E-Commerce Site in the country, about 2x the nett sales of Flipkart.com the next name on that list AFAIK. The sort of demand they see in the peak tatkal booking hours I suspect is orders of magnitude higher than what flipkart can handle. For instance something as small (relatively) as the recent Moto-E launch in India took down flipkart infrastructure ( Flipkart server crashes as Motorola Moto E goes on sale ).
  • Over 8 billion trips per year are undertaken in Indian Railways and bulk of the booking happens through this system. Even on a record-breaking day, Amazon only sold 13.5 million items worldwide, whereas Indian Railways on the whole sells more than 21 million tickets on any average day. The electronic system was put in place in the 80s and has since received multiple incremental updates.

  • Of these, IRCTC books around 250 million tickets per annum. It operates just the outermost web layer. So, while webserver configurations, website architecture, and other improvements will play a role, problems with booking a ticket are spread across every layer up to the database. Moreover, the failures at each stage of booking compound because a person who failed at the last step will start afresh right from log in.
  • The problem is not just the insufficiently responsive ticketing interface, but the huge demand-supply ratio. Even if the whole process was totally seamless, we would’ve only ensured that the first 20 million or so people got their tickets every day, but 3 times as many people will still be left without a reservation.

Bottlenecks and solutions

Technical -

Seat selection

  • Also the railway system is far more complex then say a straight forward purchase from amazon or a Google search.Tickets are commodities, while seats and berths are not! This adds to the complexity. Let’s say Amazon had an inventory of a million toothbrushes and 2 million people try to buy the same item. I’m assuming they’ll just need to decrement the counter and complete the transaction with buyers on a first-come first-served basis, without worrying about which exact toothbrush will go to whom (at the time of sale). In contrast, Indian Railways offers a precisely labelled berth or seat to a ticket buyer.
  • In database terms, a row-level lock is obtained on the berth, while thousands of transactions compete for that! A better way would be to sell tickets first and allot the berths later. If passengers can handle the sophistication, they can even do a check-in later, but I think we’re still quite some time away from that. The current logic for berth preference can be retained, but applied as a separate step. In reservation centres, there can be a separate berth allotment counter for confirmed ticket holders.
  • This could use a stateful precompute algorithm that generates the next candidate seat and provides it dynamically. Then generates the next one as a background async process.
Payments

  • Another huge bottleneck is in processing payments. It involves a series of menu selections by users each causing pages to load followed by complex handshakes between IRCTC, third party gateways, and the banks, security checks and so on. Each step is prone to failures too. On the whole, 29% of attempted payments failed.
  • Why not deduct money before ticket booking begins for the day and return it if booking is unsuccessful? Actually, IRCTC is instead considering a smarter move by which passengers can keep prepaid cash with them. Apart from the obvious performance improvement, the economic implications are huge. Imagine crores of rupees lying with them without a need to pay interest? Already, Indian Railways benefits from having an Advance Reservation Period of 4 months. Together, effectively, passenger money is deposited several months in advance. Remember Dell?
  • Possibly they could have credit cards on file . Google Play, Itunes and many others already do this, your next ticket could be a couple of clicks away, EVEN ON MOBILE !
Database

  • It becomes apparent a lot of this is to do with their database architecture they perhaps could implement a beefier database cluster with ample replication and sharding. A lot of the work is read bound and this could most certainly be improved.
  • If the database and application layers are appropriately coupled it should be possible to implement some sort of active caching, thus minimising rapid read impact without losing out on data validity.
  • A lot of the sporadic load comes around the tatkal tickets. This is a tiny fraction of the huge data open to booking. A good architecture would be to to shard this critical hot data into highly optimised database that would be tuned for concurrent locks and writes and offer high availability for read throughputs. Also tune your application to handle this separately optimised for the job at hand. Use beefy hardware for the same (plenty of ram,cpu network bandwidth etc)

Application Design and Architecture


  • Toss out the monolithic web app and validation system
  • USING A CMS for this scale is (IRCTC uses BroadVision’s CMS) an epic fail
  • Ditch the Windows Stack , Move to Unix based environments, enable Gzip compression , use stuff like Flashcache, HA-Proxy, Docker dynamic scaling deployments depending on the time of the day. For instance add 5x the power during peak. Use a combination of Cloud on demand and self hosted infra for best results.
  • Remove banner adverts, they as the railways should not need this , keep a clean minimal interface that does the job.
  • Move the session handling into another layer and should be much more graceful. The load of the 10 min timeout in a mainloop for instance is perhaps one of the main reason for many screwups.
  • Break up critical parts into modules that are designed to scale horizontally provided the right hardware.
  • CDN for static content with multi host and redundant bandwidth across locations in the country,
  • Revamp the core api to be data driven, off load client logic into the web browser using something like Backbone or Angular - this achieves 2 things, api can be rigorously tested and hardened. Ui can be offloaded to another team that specializes in it , get better UI , easier to extend and open up possibilities for a much better api driven mobile client
Hardware & Networking


  • Update the database cluster for sure and most of the architecture that can no longer support these workloads.

  • Add edge points in all major cities and aptly geo located centres to minimise the response time (this would need a decoupled app imho for best results)
  • Sorry EC2 is no magic word like a lot of people suggest , EC2 would be a poor choice for IRCTC given where their traffic and business is based off.
  • Perhap at certain time use a Cloud hybrid deployment, you can use the elasticity of the cloud to meet peak requirements that are sporadic. If the demand is consistently at similar levels, add new physical hardware to your DC not to the cloud.
  • Add an Peakflow/Arbor and handle DDOS mitigation abilities as i suspect the railways site is victim to plenty given their importance. I would choose a device over other techniques as the 2x latencies introduced to mitigators/scrubbing centers (none in India) would just kill the purpose.
  • Dedicated redundant Bandwidth from multiple ISP , possible multihost.They always seem to choke on this, besides DDoS mitigation requires plenty of it. They are a sizable organization and should be able to get that from govt and non govt players


NON TECHNICAL

Yes IRCTC is at the end of the day a public sector body, here are some of the usual suspects

  • Bureaucracy in every step - delays getting the required people, hardware and technical expertise to fix the issue once and for all
  • Lack of political will to fix the irctc system to create a bias for the chap at the counter .
  • Possible corruption that benefits from a bad IRCTC experience such as the network of travel operators and agents with political connections/lobbies to ensure they stay in business.
  • Lack of funds
  • The top down culture could have put some people averse to change and ones lacking the technical inclination required so this may not feature on their priority list or could be fooled by the software vendor into sub standard software CMS running on a windows stack ;)

This awesome article by Sundar Lakshmanan was the inspiration to the answer.Five things IRCTC ticketing site must fix: A geek's wishlist for IRCTC/Indian Railways - NextBigWhat. It got me thinking as to how this issue can be resolved and come up with the numerous ideas. Feel free to suggest and add more , perhaps a sort of answer wiki.

Link to the original reply: *www.quora.com/Indian-Railways/What...C-website-to-be-so-slow-and-unpleasant-to-use

And hence, any kind of reform IRCTC does is appreciated.

^I have already read that and it largely doesn't applies, practically.

well, its a very deep insight
 

gagan_kumar

Wise Old Owl
Well, how quick do you remember booking a tatkal ticket on IRCTC ? Been booking for years, I get to book every now and then a tatkal ticket, every week (coincidentally), so my experience said anything below 10:10 was very good; luck was on your side.

But yesterday, I booked one at 10:05. Saw that IRCTC had introduced a new site which was very very fast (same as TDF or any normal site), that too at the time of peak load (tatkal hours).

And today, I booked a ticket at 10:02. I wasn't believing my eyes.

Many other people are having same experience, so it pretty much says that I wasn't lucky. IRCTC has really done something. Great.

Achche din ?

PS: A down side of this is the people queuing overnight at station counters will be easily outperformed by the e prowess, which I have always admitted is not good for majority. I'm not saying that IRCTC shouldn't have improved, but this good wasn't required. A balance has to be made between load of the server and the respective allotment of the tickets to cater both groups.

well idk much about tatkal but it should open first for offline ticket booking then online like 1 hour difference should suffice ..........
 

whitestar_999

Super Moderator
Staff member
actually this might be true.cbi unearthed a group of booking agents who had managed to install their own booking software directly linked to one of the booking terminal inside mumbai railways office resulting in almost zero public access to tatkal tickets on that server during booking hours.it was suspected that there were other groups hijacking booking servers in such manner.of course none of this is possible without the involvement of railway officials.maybe because of new govt such things have stopped finally freeing much of the tatkal tickets which were earlier pocketed exclusively by booking agents in such groups.
 
Status
Not open for further replies.
Top Bottom