FAQ.Capacity_Planning.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. $Id: FAQ.Capacity_Planning.txt,v 1.6 2022/04/23 13:45:59 gilles Exp gilles $
  2. This documentation is also available online at
  3. https://imapsync.lamiral.info/FAQ.d/
  4. https://imapsync.lamiral.info/FAQ.d/FAQ.Capacity_Planning.txt
  5. ======================================================================
  6. Imapsync tips for Capacity Planning.
  7. ======================================================================
  8. I plan to go to a distributed architecture for the online service. I'm
  9. doing some capacity planning. Imapsync takes memory, cpu and bandwidth
  10. in a relatively deterministic values.
  11. My current question is: Shall I use
  12. * N 2GB hosts
  13. * N/2 4GB hosts
  14. * N/4 8GB hosts
  15. Let's do some observations and maths
  16. The observations are done on the standalone imapsync online which
  17. characteristics are:
  18. CPU: Intel i5-2300 with 4 cores
  19. RAM: 16 GB
  20. NET: 100 Mbps symetrical, 12.5 MBytes/s symetrical,
  21. so 25 MBytes/s max for a global imapsync rate.
  22. Disks: I don't know.
  23. System: FreeBSD 11.4
  24. ===== CPU =====
  25. The CPU can be an issue. On average, an imapsync run takes 5% of the
  26. overall cpu time for a Intel i5-2300 with 4 cores. It implies 20
  27. imapsync runs is ok on the current online host before the cpus become
  28. the bottleneck. As a rule of thumb, imapsync takes 20% of a cpu core.
  29. In the Intel i5-2300 4 cores, so far, the maximum number of imapsync
  30. processes has been 68, which is 3 times what the system should
  31. support in a standard imapsync workload. For this workload, the
  32. imapsync performamces were not good, the server could not handle the load
  33. and was even out of order for a while. For 40 imapsync processes, the
  34. the performances are ok.
  35. ===== RAM =====
  36. The RAM can be an issue. On average, an imapsync run takes 250 MB. So
  37. 4 imapsync processes per GB is the limit before swapping to disk,
  38. which is a known phenomenum telling when memory becomes the bottleneck.
  39. 16 GB allows 64 imapsync processes.
  40. On the 16GB, so far, the maximum memory usage taken by imapsync processes was
  41. 13 GB. For that value, the one minute load was 10 or more, the number of
  42. imapsync processes was around 40, the total bandwidth was around 19 MiB/s.
  43. ===== LINK =====
  44. The Bandwidth I/O can be an issue. The "Average bandwidth rate" value
  45. given by imapsync at the end of a transfer, and also the bandwidth
  46. rate given during the sync on the ETA line, is the total size of all
  47. messages copied divided by the time passed. If imapsync is run between
  48. two foreign imap servers then the total size transferred on the
  49. network link is twice this value, one time when getting the message
  50. from host1, rx, and one time sending the message to host2, tx.
  51. On average, an imapsync runs at 3 Mbps both ways, rx and tx, so 6 Mbps
  52. in total. So a 100 Mbps symetric link allows 33 imapsync processes
  53. before the link becomes the bottleneck.
  54. The best minutes observed so far are a global 187 Mpbs rate (~23 MiB/s)
  55. on a 100 Mbps symetrical link done by 28 imapsync processes in parallel,
  56. 6.7 Mbps per process at that minute. But the best minutes observed for a
  57. single imapsync process is at 103 Mbps (~13 MiB/s), the rx/tx link limit.
  58. ===== DISKS =====
  59. The harddisk I/O can be an issue. I don't measure it yet because
  60. imapsync doesn't perform heavy I/0 where it runs. Well, I don't know,
  61. no measure is no knowledge, just guesses.
  62. ===== Repartition ======
  63. Let's consider we have a bunch of different hosts able to run imapsync
  64. processes. How should we distribute imapsync jobs among them?
  65. A simple rule is "do not add more load to a host when one of the ressources
  66. has reached its maximal. The ressources are memory, bandwidth, cpu, disk.
  67. I ignore the disk part for now.
  68. maximum number of imapsync processes for a host
  69. = min( 4 * RAM_in_GB, 10 * nb_cores, bandwidth_in_mbps / 3 )