On 7/12/24 3:34 PM, Wong, Wesley wrote:
Hi, I am noticing a performance issue with Mailman 3 when using the "mailman findmember" CLI command to search for email address or name. On average, it takes about 15 - 20 seconds to run a query which is very slow IMHO. When searching through web administrator interface for Users, it takes only 1 -2 seconds. Is there a reason for such a discrepancy between the two interfaces? Is there any tuning to the CLI that could help with the performance issue? Here is the setup information regarding the VM hosting the Mailman 3 server:
This is actually https://gitlab.com/mailman/mailman/-/issues/1095
The basic loop is at https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/commands/cli_fi... and the time consuming part is https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/commands/cli_fi...
On mail.python.org which has about 75,000 users
for user in getUtility(IUserManager).users:
continue
takes a few seconds, but
for user in getUtility(IUserManager).users:
emails = [address.email for address in user.addresses]
continue
takes almost 3 minutes which is about the time that findmembers
takes
in total. I've tried changing this to
for user in getUtility(IUserManager).users:
if len(user.addresses) == 1:
emails = [user.addresses[0].emails]
else:
emails = [address.email for address in user.addresses]
continue
but it doesn't help. Just referencing user.addresses in the loop as in
for user in getUtility(IUserManager).users:
x = user.addresses
continue
takes 3 minutes.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan