I am using a STREAMS library LiS on Linux 2.6.18(Centos 5). The code
uses getmsg/putmsg calls to read/write data. The data is written/read
to E1/T1 links.
It is also observed that the LiS library consumes high CPU.
Please suggest some optimisation techniques that can be applied on
getmsg/putmsg. Are there options like scatter reads/gather
writes,TCP_CORK for the kind of interface ?
Please suggest ideas to reduce the CPU consumption of LiS.
The version of LiS used is 2.18.4
Apply oprofile to the application(s) while using a version of
the STREAMS library LiS that has been compiled with debugging
information (gcc -O -g). This should be enough to identify and
pinpoint any low-level coding details which are causing slowness
and which might be improved by standard re-coding techniques.
It might also help you decide whether the general strategy
is the problem, such as the number of times that the same data
is copied from one place to another.
--