Koozali.org: home of the SME Server

Cpu usage 100% after upgrade... Reslolved.

Offline steve288

  • *
  • 336
  • +0/-0
Cpu usage 100% after upgrade... Reslolved.
« on: April 30, 2007, 02:18:25 PM »
The following helped me reduce the CPU usage from 100% to about 10%

As I have seen someone else say IM no nerd but I discovered a couple of things. Which I hope will be of help to some. Hopefully I have the infor here right.

I have a sme 6 server/gateway and decided to go to a sme7 server.

I did a backup of 6 with the software that comes with sme and then did a restore on 7.

I noticed that the CPU usage was 100% a most of the time (use the nice little program called htop)

After some long investigation and poking I noticed that one of the logs

Kept saying
2007-04-27 12:41:27.707500500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:41:29.708533500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:41:31.353231500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:41:32.917566500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:41:34.545277500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:41:36.208919500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:41:37.559222500 unable to determine uid/gid for qpsmtpd

Over and over and over.
(UID stands for User ID and GID stands for Group ID everybody has to have both to play nice)

I did a search for the qpsmtpd directories and found several.
I learned that if you did a ls –la  on files or ls –lad on directories and saw  a number where the owner is suppose to be eg (see second column) that this means that there is no owner of these and that it is orphaned. (sad thing)

   -rw-r--r--   1 obie     pub        68476 Nov 16 12:06 accts.s
   -rw-r--r--   1 15625    pub          508 Oct 31 11:15 balance
   -rw-r--r--   1 obie     pub        40596 Aug 31 13:19 report.2

Here is a note regarding this I found on the net…
“Files without a real owner have a number in the owner and/or group name fields: “

It appearse that the New sme7 needs some users that sme6 didn’t have. When you copy over the passwd files in your restore from sme6 Im guessing it wipes out the passwd file. And adds the
I guess there are many ways to add users (I don’t know)
However One way I think is to by hand change the /etc/passwd file
Fortunate for me I have another sme7 computer I put together from scratch. I checked the passwd file and low and behold there is a line there :

 qpsmtpd:x:453:453:qpsmtpd system user:/var/service/qpsmtpd:/bin/false

Which is not on the offending computer.

I added this line into the /etc/passwd file and the error in my qpsmtpd log went from ……….
2007-04-27 12:42:33.845587500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:42:35.491892500 unable to determine uid/gid for qpsmtpd
2007-04-27 12:42:37.034624500 unable to determine uid/gid for qpsmtpd

To a happier ….
2007-04-27 12:42:38.912119500 18756 trying to get config for plugins
2007-04-27 12:42:38.921982500 18756 loading plugins from /usr/share/qpsmtpd/plugins
2007-04-27 12:42:38.926667500 18756 Loading peers
2007-04-27 12:42:38.927415500 18756 trying to get config for peers/0
2007-04-27 12:42:39.020710500 18756 peers plugin: Compiling auth/auth_cvm_unix_local
2007-04-27 12:42:39.026029500 18756 peers plugin: Compiling check_earlytalker
2007-04-27 12:42:39.029263500 18756 peers plugin: Compiling count_unrecognized_commands
2007-04-27 12:42:39.032397500 18756 peers plugin: Compiling check_relay
2007-04-27 12:42:39.035572500 18756 peers plugin: Compiling check_norelay
2007-04-27 12:42:39.062852500 18756 peers plugin: Compiling require_resolvable_fromhost
2007-04-27 12:42:39.103396500 18756 peers plugin: Compiling check_basicheaders
2007-04-27 12:42:39.106973500 18756 peers plugin: Compiling check_badmailfrom
2007-04-27 12:42:39.110147500 18756 peers plugin: Compiling check_badrcptto_patterns
2007-04-27 12:42:39.113658500 18756 peers plugin: Compiling check_badrcptto
2007-04-27 12:42:39.116704500 18756 peers plugin: Compiling check_spamhelo
2007-04-27 12:42:39.206995500 18756 peers plugin: Compiling check_smtp_forward
2007-04-27 12:42:39.210565500 18756 peers plugin: Compiling rcpt_ok
2007-04-27 12:42:39.869058500 18756 peers plugin: Compiling tnef2mime
2007-04-27 12:42:39.881407500 18756 peers plugin: Compiling spamassassin
2007-04-27 12:42:39.887120500 18756 peers plugin: Compiling virus/clamav
2007-04-27 12:42:39.892574500 18756 peers plugin: Compiling queue/qmail-queue
2007-04-27 12:42:39.893632500 18756 peers hooking valid_auth
2007-04-27 12:42:39.894309500 18756 peers hooking set_hooks
2007-04-27 12:42:39.895229500 18756 Listening on port 25
2007-04-27 12:42:39.896406500 18756 Running as user qpsmtpd, group qpsmtpd
2007-04-27 12:42:39.896956500 18756 Initializing spool_dir
2007-04-27 12:42:39.897498500 18756 trying to get config for spool_dir
2007-04-27 12:42:39.911225500 18756 Permissions on spool_dir /var/spool/qpsmtpd/ are not 0700
2007-04-27 12:42:39.911906500 18756 trying to get config for size_threshold
2007-04-27 12:42:39.912606500 18756 size_threshold set to 0


Now with my new found vigor , I noticed that
Spamd files had the same type of error that is, just a number instead of a user name when I did an ls –l

I added the following to my passwd file …

spamd:x:1005:1005:spamassassin daemon user:/var/spool/spamd:/bin/false

My CPU usage went from 100% down to about 8%

Again Im no brainiack but note that these problems I think occurred because I backed up from sme6 and restored on sme7.  By the way the error message  in the log above
“2007-04-27 12:42:39.911225500 18756 Permissions on spool_dir /var/spool/qpsmtpd/ are not 0700”

...can be ignored based on
http://wiki.contribs.org/SME_Server:Documentation:FAQ which says …
 Log Messages
 Log message regarding permissions on /var/spool/qpsmtpd/
You may see messages similar to this in your log file:
@400000004326e9472eccc42c 3243 trying to get config for spool_dir @400000004326e9472ed518fc 3243 Permissions on spool_dir /var/spool/qpsmtpd/ are not 0700
They can be safely ignored. Clamav runs under a different user and needs read access to the spool area to avoid copying the file