Monitor log4j behavior under load

I want to test a J2EE application under a heavy load of sessions, accessing different pages.

This web application uses Log4J to log errors, warnings, and information. I want to check what is a side effect of this load when writing log files, especially concurrent I / O writes.

I found the Log4j deadlock in high load conditions .

The question is, does the OS (linux) have any restriction on the simultaneous entry of an input / output file, or does Log4j handle this concurrency?

How can I control any delays in the I / O process (due to high workload) or some kind of dead end?

thanks

+6
source share
1 answer

Since no one answered my question,

This link somehow helps me solve my problem.

Log4j sequentially writes files and the console. therefore, while one thread is writing another thread, which wants to write, must wait until the other is complete. In addition, stdout can block if everything attached to it at the other end does not drain it.

unix has a special file descriptor called stdout . when launching applications on the console, stdout will be attached to the console. you can also redirect stdout to other files. ex: java Blah > /dev/null . perhaps you have stdout pointing to the file to be populated. for example, a pipe is a file, and if the program on the other end does not drain the tube, then the program that writes to the pipe is ultimately blocked.

+2
source

Source: https://habr.com/ru/post/989085/


All Articles