- Implemented a instant messaging platform using Go and WebSocket, facilitating various functionalities including user registration, login, adding contacts, message sending and reception, etc.
- Enabled both private and group chatting, along with handling diverse message formats such as text, voice, images, and emoji.
- Utilized the Gin and go-swagger for web API implementation and testing.
- Employed channels and goroutines to enhance system concurrency and real-time responsiveness, ensuring a seamless user experience.
- Leveraged MySQL for the storage of fundamental user and group information, with GORM utilized for efficient database manipulation.
- Applied Redis for caching historical data, optimizing system performance and data retrieval efficiency.
go 1.20
MySQL
Redis
If you want to build and run this application in your local environment. Please make sure you have environments mentioned above. And then you should update app.yml according your environment
And then run build.bat (for windows, build.sh for Linux) to build the application. You can access to the system in localhost:8081
Tools: JMeter
Test machine: personal laptop(AMD R7 4800H)
I first tested in normal case with 300 threads for 10 loops, achieving 5000+ TPS. The setting and results are as followed
Then I tested 300 user visited at the same time. The setting and results are as followed