Technical requirements
Passwork is not resource-demanding. The amount of RAM, CPU power and free disk space, as well as the number of servers you will need depend on the number of active users, the amount of stored data, and the system's fault tolerance requirements.
Passwork consists of two elemetns:
- An application server (web server + PHP)
- A database (MongoDB)
Both can run on a single shared dedicated or virtual server.
You can use multiple servers if:
- the application server and database should be placed on different servers to maintain security;
- data needs to be stored simultaneously on multiple servers;
- you need to ensure fault-tolerance of the system.
- The IOPS value is critical to the database operation speed, so we advise using SSD disks.
- For Linux with less than 4GB of RAM we recommend enabling a 4GB swapfile.
This option is suitable for editions of up to 500 users if there are no specific requirements for data storage:
Number of users | RAM | CPU | HDD/SSD |
---|---|---|---|
up to 50 | 2-4 GB | 4 | 100 GB |
up to 100 | 4-8 GB | 8 | 150 GB |
up to 500 | 8-16 GB | 8 | 200 GB |
In this case, the database and the application server are located on different servers.
Application server requirements:
Number of users | RAM | CPU | HDD/SSD |
---|---|---|---|
up to 50 | 2-4 GB | 4 | 100 GB |
up to 100 | 4 GB | 8 | 100 GB |
up to 500 | 8-16 GB | 8 | 100 GB |
up to 1000 | 8-16 GB | 8 | 100 GB |
up to 10 000 | 16-32 GB | 16 | 100 GB |
Database server requirements:
Number of users | RAM | CPU | HDD/SSD |
---|---|---|---|
up to 50 | 2-4 GB | 4 | 100 GB |
up to 100 | 4 GB | 4 | 150 GB |
up to 500 | 8-16 GB | 8 | 200 GB |
up to 1000 | 16 GB | 8 | 200 GB |
up to 10 000 | 16-32 GB | 16 | 200 GB |
MongoDB database can operate in failover mode. There are three main server roles in the replica set:
- Primary — the main server;
- Secondary — secondary server in synchronisation mode;
- Arbiter — a server that does not store data, but is involved in voting for the main node in case the primary server fails.
We recommend using full instances, as MongoDB built-in balancing mechanism works without an arbiter
- Three or more servers: three full-fledged database servers (the master is selected during the voting process). In this scenario you can use the arbiter as an additional server, for example when you want to achieve predictable switching of primary nodes;
- Three servers: two full-fledged database servers, one of which is selected as the primary, the other as the secondary and the third as the arbiter server. The primary node is switched automatically if the current primary server goes down. Arbiter allows you to save resources as it is less demanding.
The minimum number of replica set members is three. Otherthise, if one of the nodes fails, it will go into read-only mode and Passwork will be unavailable.
- RAM — 4 GB, CPU cores — 4, HDD/SSD — 100 GB
- High-speed network connection to the rest of the database servers.
You can use several application servers as a group of:
- multiple PHP-FPM servers horizontally;
- traffic load balancer.
This will allow to:
- Automatically redirect requests to other servers if one of the servers goes down;
- Improve application's performance when you have a lot of users (10 000 and more)
The storage space recommendations above do not take backups and logs into account. We recommend storing database backups on separate servers or in specialized storage.
The size of an archived backup takes about 10% of the database itself.
You can estimate an actual database size (without attachments) using the following table:
Number of users | Number password | Time of usage | Database size | Backup archive |
---|---|---|---|---|
up to 100 | 1000 | 1 year | 0.1 GB | 10 MB |
up to 100 | 1000 | 2 year | 0.5 GB | 50 MB |
up to 100 | 1000 | 3 year | 1 GB | 0.1 GB |
up to 1 000 | 5000 | 1 year | 1 GB | 0.1 GB |
up to 1 000 | 5000 | 2 year | 5 GB | 0.5 GB |
up to 1 000 | 5000 | 3 year | 10 GB | 0.5 GB |
up to 10 000 | 10 000 | 1 year | 10 GB | 0.5 GB |
up to 10 000 | 10 000 | 2 year | 50 GB | 1 GB |
up to 10 000 | 10 000 | 3 year | 100 GB | 2 GB |