[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14697379#comment-14697379 ] Steve Brewin commented on JAMES-1440: - In JPA, lazy fetching is only useful when the data to be fetched is infrequently referenced and is expensive to fetch. Generally it is cheaper to fetch all data eagerly as this can be achieved in a single visit to the database. All of the fields annotated with fetch=FetchType.LAZY in org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage are frequently referenced. These should be changed to fetch=FetchType.EAGER to avoid multiple visits to the database. I'll fix it! > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: James Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13656826#comment-13656826 ] Eric Charles commented on JAMES-1440: - Hi Yin, Yes, that's a big diff. Awesome! Do you run any server without problem with that config? I just ask to be sure this does not impact negatively anything else. I am running maildir, so it's not possible for me to do a complete test. If we are sure, I am happy to commit your patch (just upload it on this jira). Thx, Eric > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: James Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13656620#comment-13656620 ] Yin,Shiwu commented on JAMES-1440: -- A measure is not very accurate, but there is a big difference FetchType.LAZY 1000 mails Elapsed time >5000 ms 2000mails Elapsed time >1 ms FetchType.EAGER 1000mails Elapsed time ≈170 ms 2000mails Elapsed time ≈245 ms > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: James Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13641448#comment-13641448 ] Eric Charles commented on JAMES-1440: - Hi Yin. Can you test with FetchType.EAGER and measure the difference? Also, there may impacts (maybe?) on other queries where the flags was not fetched and they are now fetched. Thx, Eric > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: James Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13640213#comment-13640213 ] Yin,Shiwu commented on JAMES-1440: -- hi, Eric I met the same issue. Using JavaMail API with IMPA protocol, But it consumed 5s time to open INBOX mailbox that there are only 1000 mails in INBOX. I looked at the code and found some clues as follows: org.apache.james.imap.processor.base.SelectedMailboxImpl private void init() throws MailboxException { ... synchronized (this) { while(messages.hasNext()) { MessageResult mr = messages.next(); applicableFlags.add(mr.getFlags()); add(mr.getUid()); } ... } In the loop, Invoking getFlags method will costs about 5ms every time. in AbstractJPAMessage class, I found userFlags is a lazy-load strategy, which is the root cause. org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage @OneToMany(cascade = CascadeType.ALL, fetch=FetchType.LAZY) @OrderBy("id") @ElementJoinColumns({@ElementJoinColumn(name="MAILBOX_ID", referencedColumnName="MAILBOX_ID"), @ElementJoinColumn(name="MAIL_UID", referencedColumnName="MAIL_UID")}) private List userFlags; > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: James Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487658#comment-13487658 ] Eric Charles commented on JAMES-1440: - Thx for the details. I will be happy to track this down. To help, would you mind packaging a maven module in a zip with the code that feeds the 3 mails and the code that reads via pop3/imap. I would like to integrate this in the james src so we can fix this. I you need help to start the james server, just tell me, there is some sample code in the postage trunk project. Thx again for your help, Eric > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: JAMES Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487647#comment-13487647 ] james commented on JAMES-1440: -- Test both of file and db using jpa. No other configure change. > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: JAMES Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487642#comment-13487642 ] james commented on JAMES-1440: -- hi, i used codes as follows to test pop3 and imap‘s capability of james.it is so slow when use imap to connect server and get unread mail count when there are more than 3 mails. it is also slow to connect server with pop3 when the count of mail attain to 10. public static void main(String[]args){ Properties pop=new Properties(); //set pop //. Session session=Session.getDefaultInstance(pop); String host="",username="", password=""; Store store= session.getStore("imap"); //it is slow when using imap protocol store.connect(host,username, password); Folder folder = store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); int count = folder.getMessageCounts(); //it is slow when using imap protocol int uncount = folder.getUnreadMessageCounts(); } > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: JAMES Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487616#comment-13487616 ] Eric Charles commented on JAMES-1440: - Hi, POP3 does not support search function. Can you post the code you are using and also the details of your james installation (which store: db?,...) Thx, Eric > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: JAMES Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1440) Imap receive mail when there are many mails
[ https://issues.apache.org/jira/browse/JAMES-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485921#comment-13485921 ] james commented on JAMES-1440: -- hi,all I just tested the rate of searching mail used javamail api ,with imap. it is intolerable when i search unread mails in 3 mails.But with pop3,it is quickly. Why is it so? Is not imap faster than pop3 when receiving and searching mails? > Imap receive mail when there are many mails > > > Key: JAMES-1440 > URL: https://issues.apache.org/jira/browse/JAMES-1440 > Project: JAMES Server > Issue Type: Bug > Components: IMAPServer >Affects Versions: 3.0-beta4 > Environment: linux >Reporter: james > Labels: IMAP, mail > > hi,all > i have received mail from james that there are 30 thousand mails in > inbox,using javamail api with imap protocol. But it consumed 22s time to open > inbox mailbox,just open, not get messages.Then i changed the protocol to > pop3,it only cost 40ms. Why? Do imap not support good when lagre of mails? > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org