Hackathorn MySelf With Google App Engine

Hello everyone, not long ago, it liked a big big day for me because I had to create a e-commerce website. “sound’s easy right? but it wasn’t.”

why ?

Requirements:
- I have 23 hours to build the system.
- The system have to handle massive concurrency (2k+).
Main functions:
- Users can reserve products.
- Users can confirm their payment because we don’t use online payment.
- Admin can monitor orders.
- Admin can check user payments.
- Admin can change status order manually.
- Admin can export orders to excel file.

I had to do all that things. It’s time to challenge my self.

It didn’t easy to do all system with one person because I through that I had not enough time to do but I had tried it.

Firstly, I chose google app engine for running php and database server because I through that it had been very useful for helping me when the system scale up while users are using it.

Next, I’m using codeigniter php framework for this project then and I did PSD to HTML.

Then, I chose 2 main user functions to do first because admin function can do after launch project and I had limit of time. Fortunately, I can reuse code that I made from other projects before, that quite help to reduce time to do.

It’s time fly, because I started project around 2 pm. and I just started to do admin functions around 12 am. cause I went outside with my friends for 2–3 hours and fixed some html css website. I used 6 hours to build backend service and admin template so I could sleep around 6 am.

9 am, I woke up and I saw some message for my Facebook. Project owner want to add another design to website. I had to take a shower and went back to work again. It was done but they send message to fix the text many times.

However, I cloud do it. 12:50 final fully test before launching project and I have to move my workspace to another place.

1 pm. time to promote on all media that we have. I’m monitoring website when I ride on motorcycle taxi to change my workspace.

User realtime is growing very fast from 0 to 1800 users in 5 mins. I through in my mind “ I use google app engine it will not has downtime or user timeout ” after I arrived, website had 2000+ concurrency.

2400+ concurrency

around 4 pm, website had 2400+ concurrency, some user complained the website too slow, someone has show timeout. I had no plan because I always through that google app engine and google cloud sql can scale, it could not has downtime. I checked and find many solution check many docs that I had. I had no idea to fix it. I asked many friends and finally, in the bad think, there are good things I checked database memory is not enough. I had to change spec sql cloud to higher spec and I had change app engine to higher spec as well. I had to wait around 2–5 mins to restart database server but many users still told that website still slow and timeout. It can’t upload file and submitted form.

5 mins later, I’s monitoring sql agin and I’s seeing something weird because process about read, write was too much that make website slowly. So I had to restart and change it agin to higher spec and higher core. so I chose N8 to fix it. Finally, I can do it all process was reduce. CPU reduced from 197% to 130% and I tried to go to website. It’s looking good. No slow website anymore. I solved it already.

Thank everyone for suggesting many idea.