title: Why is the system CPU time (% sy) high?
body: <p>I am running a script that loads big files. I ran the same script in a single core OpenSuSe server and quad core PC. As expected in my PC it is much more faster than in the server. But, the script slows down the server and makes it impossible to do anything else.</p>
  
  <p>My script is</p>
  
  <pre><code>for 100 iterations
  Load saved data (about 10 mb)
  </code></pre>
  
  <p>time myscript (in PC)</p>
  
  <pre><code>real    0m52.564s
  user    0m51.768s
  sys    0m0.524s
  </code></pre>
  
  <p>time myscript (in server)</p>
  
  <pre><code>real    32m32.810s
  user    4m37.677s
  sys    12m51.524s
  </code></pre>
  
  <p>I wonder why "sys" is so high when i run the code in server. I used top command to check the memory and cpu usage.<img src="https://i.stack.imgur.com/ieDV6.png" alt="enter image description here">
  It seems there is still free memory, so swapping is not the reason. % sy is so high, its probably the reason for the speed of server but I dont know what is causing % sy so high. The process that is using highest percent of CPU (99%) is "myscript". %wa is zero in the screenshot but sometimes it gets very high (50 %).</p>
  
  <p>When the script is running, load average is greater than 1 but have never seen to be as high as 2.</p>
  
  <p>I also checked my disc:</p>
  
  <pre><code>strt:~ # hdparm -tT /dev/sda
  
  /dev/sda:
   Timing cached reads:   16480 MB in  2.00 seconds = 8247.94 MB/sec
   Timing buffered disk reads:   20 MB in  3.44 seconds =   5.81 MB/sec
  
  john@strt:~&gt; df -h
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/sda2       245G  102G  131G  44% /
  udev            4.0G  152K  4.0G   1% /dev
  tmpfs           4.0G   76K  4.0G   1% /dev/shm
  </code></pre>
  
  <p>I have checked these things but I am still not sure what is the real problem in my server and how to fix it. Can anyone identify a probable reason for the slowness? What could be the solution?
  Or is there anything else I should check?</p>
  
  <p>Thanks!</p>