Astec is an innovative platform that simplifies the registration and management of high school competitions in SMA Al Hikmah. We offer an integrated solution for both event organizers and participants, ensuring an efficient and well-organized process. Astec connects schools nationwide, facilitating meaningful competitions and fostering a competitive spirit among students.
High school competitions website, yeah. But actually it does more than that.
- Generate ticket that can be downloaded for every student on demand.
- Store so many picture from the user on the server (before maintenance mode, total size of picture on last day consumes almost 60GB)
- On the admin side, doing simple analytics and store it to excel that can be downloaded.
At planning phase, we have a very big problem where our server will likely not big enough to store the picture that much. So i decided to customize VPS where storage is set to 80GB, accepting the trade-off of minimal RAM (2 GB) and CPU (2 core). This server hosted our database, frontend page with nextjs, and backend with go. With some experiment and tuning, we finally got pretty good performance for this app.
Here is some of the tuning part:
- Optimize sql query (absolutely).
- Set postgresql max open conns to 25, idle conn to 25, conn max lifetime to 5 minutes (why this number? just based on our experiment).
- On frontend, use pages router so SSR is not intensive in our server.
- Limit the goroutine usage (but later we decide to remove this optimization because this is not significantly reduce RAM on production).
- Set backup data only once a day at 00:00AM.
Here’s some stuff I use for develop and deployment on VPS
Also, shoutout to Rendi Dwi Francisko for building Astec frontend from top to bottom 👍.