openedx-vlead / port-labs-to-openedx

3 stars 8 forks source link

Load/ Performance testing on Basic scaling of Open edX platform #39

Open sivashankerN opened 7 years ago

sivashankerN commented 7 years ago

This test is going to be done based on #37 . Rewuirements:

  1. VM0 - LMS only
  2. VM1 - Core machine ( Complete Open edX platform)
  3. Apache Bench (ab) for Load tesing
    Here we are going to test load on LMS and CoreMachine.
sivashankerN commented 7 years ago

VMs information *VM0 and VM1

  1. t2.large
  2. 8GB RAM
  3. 100 GB Hard drive (magnetic)
  4. vCPUs : 2
sivashankerN commented 7 years ago

Installed sysstat in both the machines.

sudo apt-get install sysstat -y

Load/Performance Test on VM0

Default load

ubuntu@ip-172-31-25-109:~$ sar -r 2 5 Linux 3.13.0-92-generic (ip-172-31-25-109) 08/25/2016 _x8664 (2 CPU)

10:08:24 AM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 10:08:26 AM 3196928 4978684 60.90 197072 719416 8593260 84.84 4203880 518576 188 10:08:28 AM 3194460 4981152 60.93 197080 719408 8593260 84.84 4206736 518576 188 10:08:30 AM 3195360 4980252 60.92 197080 719416 8593260 84.84 4205420 518584 188 10:08:32 AM 3195460 4980152 60.91 197080 719416 8593260 84.84 4204868 518584 188 10:08:34 AM 3194864 4980748 60.92 197088 719416 8593260 84.84 4205652 518592 188 Average: 3195414 4980198 60.92 197080 719414 8593260 84.84 4205311 518582 188

ubuntu@ip-172-31-25-109:~$ sar -u 2 5 Linux 3.13.0-92-generic (ip-172-31-25-109) 08/25/2016 _x8664 (2 CPU)

10:08:26 AM CPU %user %nice %system %iowait %steal %idle 10:08:28 AM all 1.52 0.00 0.51 0.76 0.00 97.22 10:08:30 AM all 1.50 0.00 0.75 0.00 0.00 97.74 10:08:32 AM all 1.75 0.00 0.50 0.25 0.25 97.24 10:08:34 AM all 2.01 0.00 0.25 0.00 0.00 97.74 10:08:36 AM all 1.50 0.00 1.00 0.00 0.00 97.49 Average: all 1.66 0.00 0.60 0.20 0.05 97.49

sivashankerN commented 7 years ago

sudo siege -c 100 -r 1 http://54.215.146.225/ Transactions: 100 hits Availability: 100.00 % Elapsed time: 1.23 secs Data transferred: 0.29 MB Response time: 0.12 secs Transaction rate: 81.30 trans/sec Throughput: 0.24 MB/sec Concurrency: 9.45 Successful transactions: 100 Failed transactions: 0 Longest transaction: 0.20 Shortest transaction: 0.07

Abut the Flags used in above command -c num - CONCURRENT, allows you to set the concurrent number of simulated users to num. The number of simulated users is limited to the resources on the computer running siege. -r NUM, REPS, allows you to run the siege for NUM repetitions

sivashankerN commented 7 years ago

sudo siege -c 1000 -r 1 http://54.215.146.225/ Transactions: 1000 hits Availability: 100.00 % Elapsed time: 7.78 secs Data transferred: 2.90 MB Response time: 0.02 secs Transaction rate: 128.53 trans/sec Throughput: 0.37 MB/sec Concurrency: 2.80 Successful transactions: 1000 Failed transactions: 0 Longest transaction: 0.18 Shortest transaction: 0.00

 Transactions
          The number of server hits.  In the example, 1000 simulated users [ -c1000 ] each hit the server 1 times
          [ -r1 ], a total of 1000 transactions. It is possible for the number of transactions to  exceed  the
          number  of  hits that were scheduled. Siege counts every server hit a transaction, which means redi‐
          rections and authentication challenges count as two hits, not one. With this regard,  siege  follows
          the HTTP specification and it mimics browser behavior.

   Availability
          This is the percentage of socket connections successfully handled by the server. It is the result of
          socket failures (including timeouts) divided by the sum of all connection attempts. This number does
          not  include  400  and 500 level server errors which are recorded in "Failed transactions" described
          below.

   Elapsed time
         The duration of the entire siege test.  This is measured from the time the user invokes siege  until
          the  last  simulated  user  completes its transactions.  Shown above, the test took  7.78 secs to complete.

   Data transferred
          The sum of data transferred to every siege simulated user.  It includes the  header  information  as
          well  as  content.   Because  it  includes  header information, the number reported by siege will be
          larger then the number reported by the server. In internet mode, which hits random URLs in a config‐
          uration file, this number is expected to vary from run to run.

   Response time
          The average time it took to respond to each simulated user's requests.

   Transaction rate
          The average number of transactions the server was able to handle per second, in a nutshell: transac‐
          tions divided by elapsed time.

   Throughput
          The average number of bytes transferred every second from the server to all the simulated users.

   Concurrency
          The average number  of  simultaneous  connections,  a  number  which  rises  as  server  performance
          decreases.

   Successful transactions
          The number of times the server responded with a return code < 400.

   Failed transactions
          The number of times the server responded with a return code >= 400 plus the sum of all failed socket
          transactions which includes socket timeouts.

   Longest transaction
          The greatest amount of time that any single transaction took, out of all transactions.

RAM utilization

CPU utilization

ubuntu@ip-172-31-25-109:~$ sar -u 2 10 Linux 3.13.0-92-generic (ip-172-31-25-109) 08/25/2016 _x8664 (2 CPU) 12:01:17 PM CPU %user %nice %system %iowait %steal %idle 12:01:19 PM all 2.50 0.00 0.75 0.25 0.00 96.50 12:01:21 PM all 2.25 0.00 0.25 0.00 0.25 97.25 12:01:23 PM all 2.26 0.00 0.50 0.00 0.00 97.24 12:01:25 PM all 24.29 0.00 6.72 0.78 0.26 67.96 12:01:27 PM all 52.69 0.00 7.42 1.28 0.51 38.11 12:01:29 PM all 47.52 0.00 10.18 0.78 0.26 41.25 12:01:31 PM all 39.49 0.00 7.69 9.49 0.26 43.08 12:01:33 PM all 5.53 0.00 1.01 0.50 0.25 92.71 12:01:35 PM all 1.50 0.00 1.25 0.00 0.00 97.25 12:01:37 PM all 2.02 0.00 0.50 0.00 0.00 97.48 Average: all 17.75 0.00 3.58 1.29 0.18 77.21

sivashankerN commented 7 years ago

All the above tests are done from one of the AWS VM and that too it is in same VPC. Tried with the

sudo siege -c 10000 -r 1 http://54.215.146.225/

This one also executed without any errors.

sivashankerN commented 7 years ago

When run same command from my local machine, I am getting the following error

siege -c 50 -r 1 http://54.215.146.225/ * SIEGE 3.0.8 * Preparing 50 concurrent users for battle. The server is now under siege... [error] socket: -2141817088 connection refused.: Connection refused [error] socket: 2132170496 connection refused.: Connection refused [error] socket: 2090211072 connection refused.: Connection refused [error] socket: -2120837376 connection refused.: Connection refused [error] socket: 2111190784 connection refused.: Connection refused [error] socket: 1995802368 connection refused.: Connection refused [error] socket: 2069231360 connection refused.: Connection refused [error] socket: 1943353088 connection refused.: Connection refused

I don't know what is the problem. I will look into this later.