[Dspam-user] Patch to reduce localtime() calls in admin.cgi for GUI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Dspam-user] Patch to reduce localtime() calls in admin.cgi for GUI

ktm@rice.edu
Dear DSPAM users,

While working on an upgrade to the current DSPAM, I noticed that
the status screen with the bar charts of 24 hour and daily activity
was taking a long time to display. Although we process a lot of
messages in a 24-day period, it was slower than I expected it to
be. After running strace() on the running admin.cgi script, I noticed
a tremendous number of localtime() system calls. The code executes a
localtime() call for every message line in the system.log file and
uses it for its binning test. I changed the test to use a precalculated
values and integer comparisons. For my system, the time to generate the
admin.cgi status pages went from 63s to 30s as a result. I have attached
the minor changes in 'diff -u' format.

Regards,
Ken

------------------------------------------------------------------------------

_______________________________________________
Dspam-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspam-user

admin-less-localtime.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Dspam-user] Patch to reduce localtime() calls in admin.cgi for GUI

Marco
> Dear DSPAM users,
>
> While working on an upgrade to the current DSPAM, I noticed that

Good this!
Are you developing a Redis driver? :)

Best Regards
Marco


------------------------------------------------------------------------------
_______________________________________________
Dspam-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspam-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Dspam-user] Patch to reduce localtime() calls in admin.cgi for GUI

ktm@rice.edu
On Tue, Oct 13, 2015 at 12:27:07PM +0200, Marco wrote:

> > Dear DSPAM users,
> >
> > While working on an upgrade to the current DSPAM, I noticed that
>
> Good this!
> Are you developing a Redis driver? :)
>
> Best Regards
> Marco
>

Hi Marco,

We are not adding a new backend, just trying to shake out some scaling
issues in the existing PostgreSQL backend.

Regards,
Ken

------------------------------------------------------------------------------
_______________________________________________
Dspam-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspam-user
Loading...