java - How to improve the streaming of static resources in spring-mvc and tomcat -


i building application plays opus audio files stored on nas mounted on application server. application reads these files, , send them http response output stream.

i using spring-mvc , web application runs on tomcat. audio files using:

<mvc:resources mapping="/audios/**" location="file:/path/to/the/mounted/nas"/> 

and serve them in <audio> tag.

now make application extremely reactive , multi user friendly. if have 20 people playing many audio simultaneously, system gets slow , not know best thing do.

could please suggest me how improve application

thanks

you have first investigate actual delay happening. in getting resource file system within code, or because tomcat not able withstand more load. make sure it's not code issue, can log code execution time , check if fine there. here way - how time method's execution in java?

now if it's tomcat server not able withstand load, looks more probable issue, might want consider having cluster of multiple tomcat instances creating load balancer configuration apache web server. way requests traffic load distributed web server running tomcat nodes, reduce latency.

you can find how configure load balancing @ these link-

http://www.tutorialspoint.com/white-papers/load-balancing-and-scalability-via-tomcat-clusters.htm

https://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -