You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/05/23 02:44:41 UTC

[james-project] branch master updated: JAMES-3734: Document tools and performance testing result for James (#1005)

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new 95213cb564 JAMES-3734: Document tools and performance testing result for James (#1005)
95213cb564 is described below

commit 95213cb56448841df2caf424601b7b9318277db4
Author: Trần Hồng Quân <55...@users.noreply.github.com>
AuthorDate: Mon May 23 09:44:36 2022 +0700

    JAMES-3734: Document tools and performance testing result for James (#1005)
---
 .../assets/images/james-imap-base-performance.png  | Bin 0 -> 192914 bytes
 .../distributed-app/docs/modules/ROOT/nav.adoc     |   4 +-
 .../pages/{operate => benchmark}/db-benchmark.adoc |   6 +-
 .../docs/modules/ROOT/pages/benchmark/index.adoc   |  10 ++
 .../ROOT/pages/benchmark/james-benchmark.adoc      | 101 +++++++++++++++++++++
 .../docs/modules/ROOT/pages/benchmark/provision.sh |  41 +++++++++
 .../docs/modules/ROOT/pages/operate/index.adoc     |   2 -
 7 files changed, 158 insertions(+), 6 deletions(-)

diff --git a/server/apps/distributed-app/docs/modules/ROOT/assets/images/james-imap-base-performance.png b/server/apps/distributed-app/docs/modules/ROOT/assets/images/james-imap-base-performance.png
new file mode 100644
index 0000000000..1caa11dc49
Binary files /dev/null and b/server/apps/distributed-app/docs/modules/ROOT/assets/images/james-imap-base-performance.png differ
diff --git a/server/apps/distributed-app/docs/modules/ROOT/nav.adoc b/server/apps/distributed-app/docs/modules/ROOT/nav.adoc
index 504a9ba3d3..e2f3e41bc2 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/nav.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/nav.adoc
@@ -59,9 +59,11 @@
 *** xref:operate/cli.adoc[]
 *** xref:operate/cassandra-migration.adoc[]
 *** xref:operate/security.adoc[]
-*** xref:operate/db-benchmark.adoc[]
 ** xref:extending/index.adoc[]
 *** xref:extending/mail-processing.adoc[]
 *** xref:extending/mailbox-listeners.adoc[]
 *** xref:extending/smtp-hooks.adoc[]
 *** xref:extending/webadmin-routes.adoc[]
+** xref:benchmark/index.adoc[Performance benchmark]
+*** xref:benchmark/db-benchmark.adoc[]
+*** xref:benchmark/james-benchmark.adoc[]
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/operate/db-benchmark.adoc b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/db-benchmark.adoc
similarity index 98%
rename from server/apps/distributed-app/docs/modules/ROOT/pages/operate/db-benchmark.adoc
rename to server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/db-benchmark.adoc
index 1f508972b3..95103627b6 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/operate/db-benchmark.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/db-benchmark.adoc
@@ -14,9 +14,9 @@ performance issues and compliance of their databases.
 
 We deploy a sample topology of Distributed James with these following databases:
 
-- Apache Cassandra 4 as main database
-- OpenDistro 1.13.1 as search engine
-- RabbitMQ 3.8.17 as message queue
+- Apache Cassandra 4 as main database: 3 nodes, each node has 8 OVH vCores CPU and 30 GB memory limit (OVH b2-30 instance).
+- OpenDistro 1.13.1 as search engine: 3 nodes, each node has 8 OVH vCores CPU and 30 GB memory limit (OVH b2-30 instance).
+- RabbitMQ 3.8.17 as message queue: 3 Kubernetes pods, each pod has 0.6 OVH vCore CPU and 2 GB memory limit.
 - OVH Swift S3 as an object storage
 
 With the above system, our email service operates stably with valuable performance.
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/index.adoc b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/index.adoc
new file mode 100644
index 0000000000..8adfa971dc
--- /dev/null
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/index.adoc
@@ -0,0 +1,10 @@
+= Distributed James Server &mdash; Performance testing the Distributed server
+:navtitle: Performance testing the Distributed server
+
+The following pages detail how to do performance testing for the Distributed server also its database.
+
+Once you have a Distributed James server up and running you then need to ensure it operates correctly and has a decent performance.
+You may need to do performance testings periodically to make sure your James performs well.
+
+We introduced xref:benchmark/james-benchmark.adoc[tools and base benchmark result for Distributed James] also xref:benchmark/db-benchmark.adoc[James database's base performance and how to benchmark them]
+to cover this topic.
\ No newline at end of file
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/james-benchmark.adoc b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/james-benchmark.adoc
new file mode 100644
index 0000000000..839c4296e7
--- /dev/null
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/james-benchmark.adoc
@@ -0,0 +1,101 @@
+= Distributed James Server benchmark
+:navtitle: James benchmarks
+
+This document provides benchmark methodology and basic performance of Distributed James as a basis for a James administrator who
+can test and evaluate if his Distributed James is performing well.
+
+It includes:
+
+* A sample Distributed James deployment topology
+* Propose benchmark methodology
+* Sample performance results
+
+This aims to help operators quickly identify performance issues.
+
+== Sample deployment topology
+
+We deploy a sample topology of Distributed James with these following components:
+
+- Distributed James: 3 Kubernetes pods, each pod has 2 OVH vCore CPU and 4 GB memory limit.
+- Apache Cassandra 4 as main database: 3 nodes, each node has 8 OVH vCores CPU and 30 GB memory limit (OVH b2-30 instance).
+- OpenDistro 1.13.1 as search engine: 3 nodes, each node has 8 OVH vCores CPU and 30 GB memory limit (OVH b2-30 instance).
+- RabbitMQ 3.8.17 as message queue: 3 Kubernetes pods, each pod has 0.6 OVH vCore CPU and 2 GB memory limit.
+- OVH Swift S3 as an object storage
+
+== Benchmark methodology and base performance
+
+=== Provision testing data
+
+Before doing the performance test, you should make sure you have a Distributed James up and running with some provisioned testing
+data so that it is representative of reality.
+
+Please follow these steps to provision testing data:
+
+* Prepare James with a custom `mailetcontainer.xml` having Random storing mailet. This help us easily setting a good amount of
+provisioned emails.
+
+Add this under transport processor
+----
+<mailet match="All" class="RandomStoring"/>
+----
+
+* Modify https://github.com/apache/james-project/tree/master/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/provision.sh[provision.sh]
+upon your need (number of users, mailboxes, emails to be provisioned).
+
+Currently, this script provisions 10 users, 15 mailboxes and hundreds of emails for example. Normally to make the performance test representative, you
+should provision thousands of users, thousands of mailboxes and millions of emails.
+
+* Add the permission to execute the script:
+----
+chmod +x provision.sh
+----
+
+* Install postfix (to get the smtp-source command):
+----
+sudo apt-get install postfix
+----
+
+* Run the provision script:
+----
+./provision.sh
+----
+
+After provisioning once, you should remove the Random storing mailet and move on to performance testing phase.
+
+=== Provide performance testing method
+
+We introduce the tailored https://github.com/linagora/james-gatling[James Gatling] which bases on https://gatling.io/[Gatling - Load testing framework]
+for performance testing against IMAP/JMAP servers. Other testing method is welcome as long as you feel it is appropriate.
+
+Here are steps to do performance testing with James Gatling:
+
+* Setup James Gatling with `sbt` build tool
+
+* Configure the `Configuration.scala` to point to your Distributed James IMAP/JMAP server(s). For more configuration details, please read
+https://github.com/linagora/james-gatling#readme[James Gatling Readme].
+
+* Run the performance testing simulation:
+----
+$ sbt
+> gatling:testOnly SIMULATION_FQDN
+----
+
+In there: `SIMULATION_FQDN` is fully qualified class name of a performance test simulation.
+
+We did provide a lot of simulations in `org.apache.james.gatling.simulation` path. You can have a look and choose the suitable simulation.
+`sbt gatling:testOnly org.apache.james.gatling.simulation.imap.PlatformValidationSimulation` is a good starting point. Or you can even customize your simulation also!
+
+Some symbolic simulations we often use:
+
+* IMAP: `org.apache.james.gatling.simulation.imap.PlatformValidationSimulation`
+* JMAP draft: `org.apache.james.gatling.simulation.jmap.draft.PlatformValidationSimulation`
+* JMAP rfc8621: `org.apache.james.gatling.simulation.jmap.rfc8621.PushPlatformValidationSimulation`
+
+=== Base performance result
+
+A sample IMAP performance testing result (PlatformValidationSimulation):
+
+image::james-imap-base-performance.png[]
+
+If you get a IMAP performance far below this base performance, you should consider investigating for performance issues.
+
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/provision.sh b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/provision.sh
new file mode 100755
index 0000000000..0f3c86e8f5
--- /dev/null
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/provision.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+export WEBADMIN_BASE_URL="http://localhost:8000"
+export SMTP_URL="localhost:25"
+export DOMAIN_NAME="domain.org"
+export USERS_COUNT=10
+export DUMMY_MAILBOXES_COUNT=10
+export DUMMY_EMAILS_COUNT=100
+
+# Create domain
+curl -X PUT ${WEBADMIN_BASE_URL}/domains/${DOMAIN_NAME}
+
+for i in $(seq 1 $USERS_COUNT)
+do
+  # Create user
+   echo "Creating user $i"
+   username=user${i}@$DOMAIN_NAME
+   curl -XPUT ${WEBADMIN_BASE_URL}/users/$username \
+     -d '{"password":"secret"}' \
+     -H "Content-Type: application/json"
+
+  # Create mailboxes for each user
+   echo "Creating user $i mailboxes"
+   # Create some basic mailboxes
+   curl -XPUT ${WEBADMIN_BASE_URL}/users/${username}/mailboxes/INBOX
+   curl -XPUT ${WEBADMIN_BASE_URL}/users/${username}/mailboxes/Outbox
+   curl -XPUT ${WEBADMIN_BASE_URL}/users/${username}/mailboxes/Sent
+   curl -XPUT ${WEBADMIN_BASE_URL}/users/${username}/mailboxes/Draft
+   curl -XPUT ${WEBADMIN_BASE_URL}/users/${username}/mailboxes/Trash
+
+   # Create some other dummy mailboxes
+   for j in $(seq 1 $DUMMY_MAILBOXES_COUNT)
+   do
+     dummyMailbox=MAILBOX${j}
+     curl -XPUT ${WEBADMIN_BASE_URL}/users/${username}/mailboxes/$dummyMailbox
+   done
+done
+
+# Create many dummy randomly messages (DUMMY_EMAILS_COUNT*4 to DUMMY_EMAILS_COUNT*8 messages range)
+echo "Creating various dummy emails"
+smtp-source -m ${DUMMY_MAILBOXES_COUNT} -f user1@domain.org -t user2@domain.org ${SMTP_URL}
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/operate/index.adoc b/server/apps/distributed-app/docs/modules/ROOT/pages/operate/index.adoc
index 0eaee06f3e..e146864442 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/operate/index.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/operate/index.adoc
@@ -24,8 +24,6 @@ distributed James operators.
 
 We also included a guide for xref:operate/migrating.adoc[migrating existing data] into the distributed server.
 
-We introduced xref:operate/db-benchmark.adoc[James database's base performance and how to benchmark] them.
-
 Read more about xref:operate/cassandra-migration.adoc[Cassandra data migration].
 
 == Upgrading


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org