We are facing a problem in an application using EJBs. We are using JBoss2.4, ejb 1.1 compliant beans, Oracle 8i database on Solaris server. We have around 20 tables in the database, out of which, 4 tables are used most frequently. In all these four tables, maximum inserts (create through bean's home interface) are being called, means no select, update, delete. In a day, around 12,000 to 13,000 records are inserted in all these four tables.
We have noticed that when the application server is started/restarted, the
application runs pretty smoothly... but after like around 3-4 days (each day around 12000-13000 records inserted)..... delay is noticed while inserting new records. The delay happens for insert, meaning between create() and ejbCreate() of the entitybean. The create() in home
interface gets called, and it takes long time in calling the ejbCreate on the server side.
The delay begins after 3-4 days, with a couple of seconds and incrementally increases to get into minutes. Once the delay starts in seconds, in less than 4 hours, it increases in minutes. At this time, when its getting delay in calling create on the bean of one of these four tables, calling create on the beans of other tables returns instantly without any delay. Ultimately we have to restart the application server and then this works well again for around 3-4 days.
Here, we are using the jboss with it's default configuration for caching and passivation policies. The default passivation period is 10 mins, max pool size of container is 100, and min pool size is 10. Do we need to tune any of these parameters or something else?
10 mins is the default passivation timeout with jboss and unfortunately, we are using the default configuration in the production. Now, on the local servers, I had few sample runs, with varying configurations and here are the statistics of the same ...
First configuration : Max pool size is 100 and default passivation timeout 10 mins (jboss default). With this configuration, I ran a sample program to insert / update 10,000 rows in the 4 tables and got the average time in milliseconds for all these runs. The average time for 10,000 rows for all these runs were between 100 to 110 milliseconds.
Second configuration : Max pool size is 500 and default passivation timeout 1 mins. With this configuration, I ran the sample program again to insert / update 10,000 rows in the 4 tables. This time, the average time for 10,000 rows was between 115 milliseconds to 135 milliseconds.
This difference doesn't look like a significant difference. These test runs have not really given us any conclusive results... so basically we are where we started with no clue as to what causes the delay at the production server... maybe the figures from the test runs can give you some insight into the problem. Any inputs would be really appreciated ...