简体   繁体   中英

Web Application becomes very slow With Java

I am developing a Java Communication Gateway (CGW), where it gets data packet from GPS device, process it and store in one table called Live table(Database is running in different server - From Java CGW i called database connection through connection pool and insert data in Live table).

On the other hand, Our web application is also reading data from same Live table. Hence when Java CGW application starts web application becomes very very slow, even first page does not open. I am using SQL server 2005.

Please suggest me why it is happening.

Thanks in advance.

Looks like your problem is a thread priority problem since reading / saving the data seems to take more processor time than expected, you could lower the thread priority by calling setPriority with a number lower than 5 in your current thread.

To get the current thread.

Thread.currentThread().setPriority(MIN_PRIORITY);

To know how to call it properly check out Set Priority method. hope this helps!

Have you done performance profiling of the DB server? Maybe workload of the DB server is too heavy. If Web application only reads the data, a master/slave database configuration should solve the DB server workload problem.

200 thread is a challenging number.

  • What is the system architectural overview?
  • How much memory is consumed for all of those threads.
  • How do you synchronize your data/communication between threads.
  • What is the hardware configuration.
  • Is it necessary to use SqlServer? the jdbc:odbc bridges could be slower than jdbc:mysql.

Usually in multi-threading scenarios, communication overhead is exponential with respect to participating agents. Also, the way data is processed: same function for many data OR multiple functions / stages for multiple data types?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM