Hello I am a student just learning to use Netty and MySQL.

I am building a server for my android and iOS application. I built my server based on using Netty 4.0.6 example HttpUploadServer.

The server's primary task is to send/recieve and save images and audio files(about 1mb in total). About 10,000 requests will be sent daily.

One of my advisor said that two things should be the most thought about when developing a server.

  • Scaling up and out
  • High availability

However, (as I am just learning server programming) I have no idea how to do them. The only thing I can think to increase scalability and availability is something like Amazon's Elastic Load Balancer.

I know this is a very broad question, but please give me a headway. How can I increase scalability and availablity using Java(Espcially Netty)?

有帮助吗?

解决方案

Scaling up can be achieved trough many techniques

  • Having multiple instances: aka Elastic Load Balancers
  • Sharding: server 1 handles requests for users A-M server 2 handles requests for users N-Z
  • Add caching: Are you servicing the same request multiple times? Throw some memory at the problem at keep serving the same answer
  • Simplify your workload!

The really important question you need to answer is what is limiting your ability to server N+1 clients. Are you running out of sockets, memory, cpu time, db transactions?

Like any profiling problem work out what your dominant problem is and solve it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top