Memory and performance of the mail gateway

I spent the afternoon digging through the performance and memory
problems people have been seeing with 3.0.x. I was able to improve
performance significantly on large messages, though the memory footprint
is still heavy. (Due to the way that perl works, it’s not going to
really “let go” of memory, though it will reuse it in subsequent
processing)

In the stats quoted below, /tmp/msg is a 500 byte message. /tmp/ex is a
10,000,000 (10 megabyte) message. I was able to improve processing on a
the 10 meg message by a factor of 4. This should be enough to cut down
the timeout issues folks are seeing. Some of the fix will be in RT
3.0.5. The rest will be in DBIx::SearchBuilder 0.90, which should be out
tonight. Upgrading your current version of searchbuilder to 0.90 should
result in significantly better performance when mailing large
attachments to RT.

BEFORE:
[localhost:~] root# time /opt/rt3/bin/rt-mailgate --action correspond --queue general --url http://localhost/ --debug < /tmp/msg
Connecting to http://localhost//REST/1.0/NoAuth/mail-gateway at /opt/rt3/bin/rt-mailgate line 403, <> chunk 1.
ok
Ticket: 49
Queue: General
Owner: Nobody
Status: new
Subject:
Requestor: jesse@fsck.com
0.330u 0.030s 0:03.42 10.5% 0+0k 0+0io 0pf+0w
[localhost:~] root# time /opt/rt3/bin/rt-mailgate --action correspond --queue general --url http://localhost/ --debug < /tmp/ex
Connecting to http://localhost//REST/1.0/NoAuth/mail-gateway at /opt/rt3/bin/rt-mailgate line 403, <> chunk 1.
ok
Ticket: 50
Queue: General
Owner: Nobody
Status: new
Requestor: jen@englishmajor.com
2.470u 1.000s 2:14.06 2.5% 0+0k 0+0io 0pf+0w

AFTER:

[localhost:~] root# time /opt/rt3/bin/rt-mailgate --action correspond --queue general --url http://localhost/ --debug < /tmp/msg
Connecting to http://localhost//REST/1.0/NoAuth/mail-gateway at /opt/rt3/bin/rt-mailgate line 404, <> chunk 1.
ok
Ticket: 47
Queue: General
Owner: Nobody
Status: new
Subject:
Requestor: jesse@fsck.com
0.350u 0.050s 0:04.08 9.8% 0+0k 0+0io 0pf+0w
[localhost:~] root# time /opt/rt3/bin/rt-mailgate --action correspond --queue general --url http://localhost/ --debug < /tmp/ex
Connecting to http://localhost//REST/1.0/NoAuth/mail-gateway at /opt/rt3/bin/rt-mailgate line 404, <> chunk 1.
ok
Ticket: 48
Queue: General
Owner: Nobody
Status: new
Requestor: jen@englishmajor.com
2.610u 0.900s 0:33.86 10.3% 0+0k 0+0io 0pf+0w
[localhost:~] root#

http://www.bestpractical.com/rt – Trouble Ticketing. Free.