This is a very general question with potential bottlenecks in several places :
- DB
- JAVA code
- JVM configuration
- Network
The first advice would be to determine where the time is spent during that processing and then ask SO concrete questions about how to improve each point.