Gnus development mailing list
 help / color / mirror / Atom feed
* Exchange Updating Info Problem
@ 2008-04-03 16:41 Jake Colman
  2008-04-08 21:44 ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Jake Colman @ 2008-04-03 16:41 UTC (permalink / raw)
  To: ding


If I enter an Exchange IMAP group with alot of read messages, Gnus takes
an awfully long time to process.  My imap-log shows the following:

1167 SELECT "INBOX/Principia"
* 15310 EXISTS
* 2 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
* OK [UNSEEN 15309] Is the first unseen message
* OK [UIDVALIDITY 1296] UIDVALIDITY value
* OK [UIDNEXT 15320] The next unique identifier value
1167 OK [READ-WRITE] SELECT completed.
1168 UID SEARCH UNSEEN UNDELETED
* SEARCH 15318 15319
1168 OK SEARCH completed.
1169 UID SEARCH SEEN
* SEARCH 1 2 3 4..............

The result if the "SEARCH SEEN" is a huuuuuge amount of data.  It
totally floods my imap-log.

Following this is the following:

1169 OK SEARCH completed.
1170 UID SEARCH FLAGGED
* SEARCH
1170 OK SEARCH completed.
1171 UID SEARCH ANSWERED
* SEARCH 15300
1171 OK SEARCH completed.
1172 UID SEARCH RECENT
* SEARCH 15318 15319
1172 OK SEARCH completed.
1173 EXAMINE "INBOX/Principia"

plus more stuff.

The problem appears to be the SEARCH SEEN command.

Thanks for any help.

...Jake


-- 
Jake Colman
Director of Software Development
Principia Partners LLC
101 West Elm Street
Suite 620
Conshohocken, PA  19428
+1 (610) 755-9786
www.principiapartners.com




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-03 16:41 Exchange Updating Info Problem Jake Colman
@ 2008-04-08 21:44 ` Ted Zlatanov
  2008-04-09  2:28   ` Jake Colman
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ted Zlatanov @ 2008-04-08 21:44 UTC (permalink / raw)
  To: Jake Colman; +Cc: ding

On Thu, 03 Apr 2008 12:41:15 -0400 Jake Colman <colman@ppllc.com> wrote: 

Jake> If I enter an Exchange IMAP group with alot of read messages, Gnus takes
Jake> an awfully long time to process.  My imap-log shows the following:
...
Jake> The result if the "SEARCH SEEN" is a huuuuuge amount of data.  It
Jake> totally floods my imap-log.
...
Jake> The problem appears to be the SEARCH SEEN command.

For me it generates a long list of integers (UIDs) on an Exchange 2007
server (see at end).  Are you seeing something different?  If it's just
the 15K article UID numbers, it's unlikely to be the main reason for the
slowness on the Gnus side.  I see much more than that in other
non-Exchange IMAP groups.  Could it be that Exchange itself is slow, or
something else is causing the slowness in Gnus?  If you can run this
IMAP command directly against the Exchange server, that would be great.

Here's a function to run an IMAP ALL search (untested but copied from
working code) which will pop up in the debugger a list of all the
messages in the mailbox and two timestamps around the SEARCH operation.
You may have to play with it:

  (let ((user "you")              ; edit
	(server "yourserver")     ; these
	(password "yourpassword") ; parameters
	(mailbox "INBOX.test"))   ; first
    (with-current-buffer (imap-open server nil 'ssl)
      (imap-authenticate user password)
      (imap-mailbox-select mailbox)      
      (debug (format-time-string "before search: %T")
             (imap-search "ALL") 
             (format-time-string "after search: %T"))
      (imap-close)))

Hit `q' to close the debugger.  If this is fast, then the "UID SEARCH
SEEN" IMAP command is probably fast too.

Simon, if my approach is suspect, please let us know.

Ted

| | | | | 6 -> imap-send-command-1: cmdstr="22 UID SEARCH SEEN"
| | | | | 6 <- imap-send-command-1: nil
| | | | 5 <- imap-send-command: 22
| | | | 5 -> imap-wait-for-tag: tag=22 buffer=nil
| | | | | 6 -> imap-arrival-filter: proc=#<process imap> string="* SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 104"



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-08 21:44 ` Ted Zlatanov
@ 2008-04-09  2:28   ` Jake Colman
  2008-04-09 16:26   ` Jake Colman
  2008-04-09 20:35   ` James Cloos
  2 siblings, 0 replies; 10+ messages in thread
From: Jake Colman @ 2008-04-09  2:28 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

>>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:

   TZ> On Thu, 03 Apr 2008 12:41:15 -0400 Jake Colman <colman@ppllc.com> wrote: 
   Jake> If I enter an Exchange IMAP group with alot of read messages, Gnus
   Jake> takes
   Jake> an awfully long time to process.  My imap-log shows the following:
   TZ> ...
   Jake> The result if the "SEARCH SEEN" is a huuuuuge amount of data.  It
   Jake> totally floods my imap-log.
   TZ> ...
   Jake> The problem appears to be the SEARCH SEEN command.

   TZ> For me it generates a long list of integers (UIDs) on an Exchange 2007
   TZ> server (see at end).  Are you seeing something different?  If it's just
   TZ> the 15K article UID numbers, it's unlikely to be the main reason for the
   TZ> slowness on the Gnus side.  I see much more than that in other
   TZ> non-Exchange IMAP groups.  Could it be that Exchange itself is slow, or
   TZ> something else is causing the slowness in Gnus?  If you can run this
   TZ> IMAP command directly against the Exchange server, that would be great.

   TZ> Here's a function to run an IMAP ALL search (untested but copied from
   TZ> working code) which will pop up in the debugger a list of all the
   TZ> messages in the mailbox and two timestamps around the SEARCH operation.
   TZ> You may have to play with it:

   TZ>   (let ((user "you")              ; edit
   TZ> 	(server "yourserver")     ; these
   TZ> 	(password "yourpassword") ; parameters
   TZ> 	(mailbox "INBOX.test"))   ; first
   TZ>     (with-current-buffer (imap-open server nil 'ssl)
   TZ>       (imap-authenticate user password)
   TZ>       (imap-mailbox-select mailbox)      
   TZ>       (debug (format-time-string "before search: %T")
   TZ>              (imap-search "ALL") 
   TZ>              (format-time-string "after search: %T"))
   TZ>       (imap-close)))

   TZ> Hit `q' to close the debugger.  If this is fast, then the "UID SEARCH
   TZ> SEEN" IMAP command is probably fast too.

   TZ> Simon, if my approach is suspect, please let us know.

Ted,

When I evaled your function, I get the following error after it loads
the debugger:

Wrong type argument: stringp, nil

Is the imap-search command incorrect?

...Jake

-- 
Jake Colman
Director of Software Development
Principia Partners LLC
101 West Elm Street
Suite 620
Conshohocken, PA  19428
+1 (610) 755-9786
www.principiapartners.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-08 21:44 ` Ted Zlatanov
  2008-04-09  2:28   ` Jake Colman
@ 2008-04-09 16:26   ` Jake Colman
  2008-04-09 20:30     ` Ted Zlatanov
  2008-04-09 20:35   ` James Cloos
  2 siblings, 1 reply; 10+ messages in thread
From: Jake Colman @ 2008-04-09 16:26 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

>>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:

   TZ> For me it generates a long list of integers (UIDs) on an Exchange 2007
   TZ> server (see at end).  Are you seeing something different?  If it's just
   TZ> the 15K article UID numbers, it's unlikely to be the main reason for the
   TZ> slowness on the Gnus side.  I see much more than that in other
   TZ> non-Exchange IMAP groups.  Could it be that Exchange itself is slow, or
   TZ> something else is causing the slowness in Gnus?  If you can run this
   TZ> IMAP command directly against the Exchange server, that would be great.

   TZ> Here's a function to run an IMAP ALL search (untested but copied from
   TZ> working code) which will pop up in the debugger a list of all the
   TZ> messages in the mailbox and two timestamps around the SEARCH operation.
   TZ> You may have to play with it:

   TZ>   (let ((user "you")              ; edit
   TZ> 	(server "yourserver")     ; these
   TZ> 	(password "yourpassword") ; parameters
   TZ> 	(mailbox "INBOX.test"))   ; first
   TZ>     (with-current-buffer (imap-open server nil 'ssl)
   TZ>       (imap-authenticate user password)
   TZ>       (imap-mailbox-select mailbox)      
   TZ>       (debug (format-time-string "before search: %T")
   TZ>              (imap-search "ALL") 
   TZ>              (format-time-string "after search: %T"))
   TZ>       (imap-close)))

   TZ> Hit `q' to close the debugger.  If this is fast, then the "UID SEARCH
   TZ> SEEN" IMAP command is probably fast too.

Ted,

I must have done something stupid last night but I ran this test again
and this time it worked.

Start Time: 12:19:31
End Time:   12:20:50

So it is well over a minute to enter the group.  With Exchange 5.5 I did
not have this problem.

...Jake


-- 
Jake Colman
Director of Software Development
Principia Partners LLC
101 West Elm Street
Suite 620
Conshohocken, PA  19428
+1 (610) 755-9786
www.principiapartners.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-09 16:26   ` Jake Colman
@ 2008-04-09 20:30     ` Ted Zlatanov
  0 siblings, 0 replies; 10+ messages in thread
From: Ted Zlatanov @ 2008-04-09 20:30 UTC (permalink / raw)
  To: Jake Colman; +Cc: ding

On Wed, 09 Apr 2008 12:26:04 -0400 Jake Colman <colman@ppllc.com> wrote: 

Jake> I must have done something stupid last night but I ran this test
Jake> [UID SEARCH SEEN] again and this time it worked.

Jake> Start Time: 12:19:31
Jake> End Time:   12:20:50

Jake> So it is well over a minute to enter the group.  With Exchange 5.5 I did
Jake> not have this problem.

I don't know if we can do much about it.  We apparently need to look at
the SEEN messages every time we visit a group.  Perhaps it's because
they might be ticked (Simon, Reiner, anyone that knows please let me
know).

Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-08 21:44 ` Ted Zlatanov
  2008-04-09  2:28   ` Jake Colman
  2008-04-09 16:26   ` Jake Colman
@ 2008-04-09 20:35   ` James Cloos
  2008-04-10 13:12     ` Ted Zlatanov
  2 siblings, 1 reply; 10+ messages in thread
From: James Cloos @ 2008-04-09 20:35 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: Jake Colman, ding

>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

Ted> For me it generates a long list of integers (UIDs) on an Exchange
Ted> 2007 server (see at end).  Are you seeing something different?  If
Ted> it's just the 15K article UID numbers,

Parsing those 15k digit strings into ints and then compressing them into
ranges can take a lot of CPU when done in elisp.

Especially when there are gaps.

The CPU usage after I modified dbmail to use per-group UIDs rather than
per-server UIDs was miniscule compared to what I got with stock dbmail.

And all of it was due to the range compression function(s).

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-09 20:35   ` James Cloos
@ 2008-04-10 13:12     ` Ted Zlatanov
  2008-04-10 14:51       ` James Cloos
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2008-04-10 13:12 UTC (permalink / raw)
  To: James Cloos; +Cc: Jake Colman, ding

On Wed, 09 Apr 2008 16:35:44 -0400 James Cloos <cloos@jhcloos.com> wrote: 

>>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:
Ted> For me it generates a long list of integers (UIDs) on an Exchange
Ted> 2007 server (see at end).  Are you seeing something different?  If
Ted> it's just the 15K article UID numbers,

JC> Parsing those 15k digit strings into ints and then compressing them into
JC> ranges can take a lot of CPU when done in elisp.

JC> Especially when there are gaps.

Sure, but can it be avoided?  I don't think the Gnus flags map directly
to IMAP flags, so it's possible there are SEEN messages that need to be
retrieved.  I think someone with in-depth knowledge of the relevant
nnimap and imap code should comment.

In addition, I don't think processing a list 15,000 integers is too slow
with Emacs Lisp on a modern machine.

The other issue is that the SEARCH SEEN itself takes a long time, over a
minute according to Jake's calculation.  See his followup.  So the
number of UIDs may be a red herring.

Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-10 13:12     ` Ted Zlatanov
@ 2008-04-10 14:51       ` James Cloos
  2008-04-10 18:18         ` Jake Colman
  0 siblings, 1 reply; 10+ messages in thread
From: James Cloos @ 2008-04-10 14:51 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: Jake Colman, ding

>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

Ted> In addition, I don't think processing a list 15,000 integers is too
Ted> slow with Emacs Lisp on a modern machine.

In retrospect, I think the number and size of the gaps is what was
slowing things for me.  Gnus handles dense article numbers *vastly*
better than sparse ones.

I forget already which variable another poster suggested to nil, but
doing that will probably help out Jake on the "archived" groups.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-10 14:51       ` James Cloos
@ 2008-04-10 18:18         ` Jake Colman
  2008-04-10 18:55           ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Jake Colman @ 2008-04-10 18:18 UTC (permalink / raw)
  To: James Cloos; +Cc: Ted Zlatanov, ding

>>>>> "JC" == James Cloos <cloos@jhcloos.com> writes:

>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

   Ted> In addition, I don't think processing a list 15,000 integers is
   Ted> too slow with Emacs Lisp on a modern machine.

   JC> In retrospect, I think the number and size of the gaps is what
   JC> was slowing things for me.  Gnus handles dense article numbers
   JC> *vastly* better than sparse ones.

   JC> I forget already which variable another poster suggested to nil,
   JC> but doing that will probably help out Jake on the "archived"
   JC> groups.


How can we jog your memory?  What variable can it possibly be?


-- 
Jake Colman
Director of Software Development
Principia Partners LLC
101 West Elm Street
Suite 620
Conshohocken, PA  19428
+1 (610) 755-9786
www.principiapartners.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Exchange Updating Info Problem
  2008-04-10 18:18         ` Jake Colman
@ 2008-04-10 18:55           ` Ted Zlatanov
  0 siblings, 0 replies; 10+ messages in thread
From: Ted Zlatanov @ 2008-04-10 18:55 UTC (permalink / raw)
  To: Jake Colman; +Cc: James Cloos, ding

On Thu, 10 Apr 2008 14:18:37 -0400 Jake Colman <colman@ppllc.com> wrote: 

>>>>>> "JC" == James Cloos <cloos@jhcloos.com> writes:
>>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

Ted> In addition, I don't think processing a list 15,000 integers is
Ted> too slow with Emacs Lisp on a modern machine.

JC> In retrospect, I think the number and size of the gaps is what
JC> was slowing things for me.  Gnus handles dense article numbers
JC> *vastly* better than sparse ones.

JC> I forget already which variable another poster suggested to nil,
JC> but doing that will probably help out Jake on the "archived"
JC> groups.

Jake> How can we jog your memory?  What variable can it possibly be?

It was Daniel Pittman in <87prsyo1dn.fsf@rimspace.net>.

Please remember the slowness is on your server.  We need to find out if
the "UID SEARCH SEEN" command is necessary (I asked here), we are
certain it's taking over a minute on your Exchange server.  Once that's
fixed we can look at other issues, but for now I'm sure it's not the
reason why things are slow for you.

While we're waiting you can move some messages out of the mailbox, it
may make the search faster.

Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-04-10 18:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-03 16:41 Exchange Updating Info Problem Jake Colman
2008-04-08 21:44 ` Ted Zlatanov
2008-04-09  2:28   ` Jake Colman
2008-04-09 16:26   ` Jake Colman
2008-04-09 20:30     ` Ted Zlatanov
2008-04-09 20:35   ` James Cloos
2008-04-10 13:12     ` Ted Zlatanov
2008-04-10 14:51       ` James Cloos
2008-04-10 18:18         ` Jake Colman
2008-04-10 18:55           ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).