summaryrefslogtreecommitdiff
path: root/libeufin/performance.rst
blob: a0af25a8ffd88e6ea8e48a523faca6ccf76a6d88 (plain)
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
Performance demonstrators
#########################

This document explains how to prove the following performance
requirements implemented in LibEuFin.

1. Long-polling offered by Nexus to the Exchange Wirewatch.
2. Reduced usage of disk space by the database.
3. PostgreSQL short-lived database sessions.
4. Participation in the Taler benchmark.

It is worth noting that point 2 and 3 will be proved *via*
point 4.  In particular, because the benchmark is a resource
demanding activity, its impact on the database should be
enough to reflect a worst case scenario with regard to points
2 and 3.

The following two sections will describe how to run
`point 1 <Long-polling>`_, and `points 2, 3, 4 <Benchmark>`_
altogether.

Long-polling
^^^^^^^^^^^^

This demonstrator is a Docker image that installs LibEuFin
and registers one user at both Sandbox and Nexus.  The Nexus
user is set up to use the Taler Wire Gateway, to let ``curl``
emulate the Taler exchange (wire-watch).

To run the demonstrator, clone the following repository:

.. code-block:: shell-session

   git://git.taler.net/deployment

and build the Docker image:

.. code-block:: shell-session

   $ cd deployment/nlnet/task5/long-poll
   $ docker build -t long-poller .

Start the ``long-poller`` image and wait after the installation
and configuration complete.  The completion should end with a message
starting by ``Services are online!``.  At this point, it is possible
to request Taler incoming payments and observe how such request returns
**only after** we manually send Taler money to the long-polling client.

Give the following command to request Taler incoming payment
with the long-polling feature:

.. code-block:: shell-session

  $ curl -v -u test-user:x 'http://localhost:5001/facades/test-facade/taler-wire-gateway/history/incoming?delta=5&long_poll_ms=100000'

After having observed that the previous command *actually*
long-polls, send it to the background by pressing CTRL-Z.  Send
now a Taler payment to ``test-user`` with the following command.

.. code-block:: shell-session
  
   $ wire_transfer

Bring now the ``curl`` process again in the foreground, and if
it got the payment, now it shows the payment data.

Benchmark
^^^^^^^^^

This demonstrator runs the Taler benchmark that relies on LibEuFin.

Clone the following repository:

.. code-block:: shell-session

   git://git.taler.net/deployment

and build the Docker image:

.. code-block:: shell-session

   $ cd deployment/nlnet/task5/benchmark
   $ docker build -t benchmark .

Run the ``benchmark`` image and wait for its completion.  At this
point, the demonstrator prints the benchmark result regarding all
the components, and lastly the database disk usage and the LibEuFin
database session(s) duration(s).

The database disk usage is complessive, therefore it shows how all
the services occupy database disk space.  Hence if this quantity is
acceptable, then also LibEuFin's share is.

On the other hand, the database session duration concerns only LibEuFin,
and compares the *longest* database session with the whole benchmark
duration.  In particular, it shows what percentage of the whole benchmark
duration is represented by the longest LibEuFin session.  Therefore
'low' percentages mean 'short' database sessions, as it is requested
in point 3.

..
  Clone the following repository:
  
  .. code-block:: shell-session
  
     git://git.taler.net/deployment
  
  and build the Docker image:
  
  .. code-block:: shell-session
  
     $ cd deployment/nlnet/task5/date-range
     $ docker build -t date-range .