On 23.10.2016 15:52, Tullio Bettinazzi wrote:
I'm sure is noty a Db issue, the delay is not only concentrated in db functions.
The same DB operations seems to take from 4millsec to 4 sec with same data and
parameters.
Ok, so let's summarise what you have told us so far :
- this is under Tomcat 7.0.67 (missing : Java version and platform)
- the application works fine, without slowdowns (or "hiccups") when a single
user is using it
- when several users are using it simultaneously, unexplained "hiccups" happen for the
users : some (not always the same) operation seems to block for up to 4 seconds, instead
of the few milliseconds taken normally by that same operation.
- the block does not always happen at the same point in the application. It also does not
happen systematically in DB operations (but it happens sometimes in a DB operation also)
- when the block happens for one user, it usually also happens afterward for the other
users, in sequence
- the memory usage and Garbage Collection does not seem to be the cause : GC appears
"normal" and there is plenty of memory available on the system
It looks like there is some contention for a resource, between the user
sessions.
If it is not the memory or GC, nor the database, then you have to look for
something else.
I am going to assume - for now - that it is something happening in the application (as
opposed to Tomcat), which causes these hiccups.
Does the application write a logfile ? could it be that several user sessions are
competing for access to the logfile ?
(may be easy to check : turn off the logging, and see if it still happens)
Is the database on the same server ? if not, how is the connection with the database made
? (and even if it is on the same server). I am thinking of DNS as one (far-fetched)
possible issue.
Does one of the system logs indicate any problem ?
(e.g. "dmesg" under Linux; or Windows Event logs)
Can you write some little script (e.g. in perl) which just loops, and writes a log line
(with a timestamp) say every second ? that would be to check if when your java application
has a "hiccup", this script also has one at the same time, or not.
Example :
#!/usr/bin/perl
while (1) {
my ($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
my $stamp = sprintf("%04d-%02d-%02d -
%02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec);
print STDERR $stamp," one second later\n";
sleep 1;
}
Note : this script can easily be modified, e.g. to /also/ print the log message to a disk
file. This way it would be affected also if the problem is with the disk.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org