Reduce CPU time on AIX system
Posted on 2009-12-16
I need some help of writing a script file to be execute on AIX system.
Let me describe the situation and the problem.
I am having a program which will write a lot of messages to a database tables for every single database connection when user is doing any transaction. I could have many concurrent connections. However, I have given user an option to write the message to a file on disk instead of to the database table if the program detects the existence of a script file (see the below) in the system. The problem is that the CPU usage was quite high (50% usage) if this option is available (i.e. the script file exist). Now, my question is how to (or if there is a way to) write messages to a memory and then write it to the file periodically (say every 5 minutes) instead of my script (below) which write to the file for every message. Thank you.
echo $@ >> /home/logs/systemlog.log;