Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-04-2008, 03:39 AM
Project Contributor
 
Posts: 18
Default Slow CLI scripts

Hi

I wrote a perl script for managing our zimbra accounts, which means periodical syncronisation based on exports form our staff management software (add/remove users, change address book entries, change distribution list membership, verify certain user-editable fields, ...).

I realized that calls to the CLI are very slow:

"zmprov ga user@mydomain.ch" (~2s)
"zmprov gaa" (~3s)
"zmprov gaa -v" (~3s)

What you see above is that the actual call needs a lot of time, it's not really important how much information you try to get: all user information (with -v) or just the account names (~200 accounts) or just one single account. For this special case I'm glad the "-v" option exists.
But for distribution list management there is no "-v" option so I've got to get all distribution lists (gadl), then iterate through all the lists and get the members by calling zmprov for each list which consumes a lot of time.

Consequence: my script needs a long time to run through all the changes and tests, etc.

Question: is there a way to speed up these calls? Or how do your scripts look like?

Thanks
Tom
Reply With Quote
  #2 (permalink)  
Old 10-26-2009, 05:54 PM
Active Member
 
Posts: 32
Default

i had the same problem.. Did u fix that?
Reply With Quote
  #3 (permalink)  
Old 10-27-2009, 02:51 AM
Advanced Member
 
Posts: 197
Default

same to me, i remember system spent almost 1.5 days to finish one of my script (with > 50000 lines command).

by the way, i was told we should run zimbra command like this :

zmprov < cmd.file

and NOT to run zimbra command one by one, e.g.
zmprov xxxxx
zmprov xxxxx
..
Reply With Quote
  #4 (permalink)  
Old 10-27-2009, 04:02 AM
Special Member
 
Posts: 165
Default

Why does it take too much time?
Because it must retreat a lot of data.
if you use:
zmprov ga user@mydomain.ch displayname
It'll faster than before
Reply With Quote
  #5 (permalink)  
Old 10-27-2009, 07:16 AM
Moderator
 
Posts: 789
Default

I think the overhead is just in the way zmprov works i think it might start up java or something I don't know that much. It's been discussed a few times though here is a good thread

Scripting zmprov with Ruby (getting stdout/stderr)

That discusses kind of what tiger2000 is talking about, starting only one instance of zmprov and feeding it commands. Like the forum thread i psasted says though perhaps SOAP is a better way if you need to do stuff efficiently.
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0