| 1 |
------------------------- |
| 2 |
SuperClassic architecture |
| 3 |
------------------------- |
| 4 |
|
| 5 |
|
| 6 |
Firebird 2.5 offers a new working mode, also known as the SuperClassic architecture. |
| 7 |
|
| 8 |
Generally speaking, it's some kind of a compromise between Classic and SuperServer |
| 9 |
targeted to shift the scalability limits of the regular Classic Server and provide |
| 10 |
slightly better performance, as well as some features priorly unique to SuperServer. |
| 11 |
|
| 12 |
Architecturally, SuperClassic is implemented inside a single server process, with |
| 13 |
user attachments being served by threads. Similarly to SuperServer, these worker |
| 14 |
threads are shared, i.e. the server maintains a thread pool and never uses |
| 15 |
more threads than a number of active user requests running at the moment. |
| 16 |
|
| 17 |
However, unlike SuperServer which shares the page cache and metadata cache between |
| 18 |
attachments, SuperClassic uses the model of private per-connection caches, similarly |
| 19 |
to the regular Classic, thus inheriting its memory usage implications. |
| 20 |
|
| 21 |
Being implemented inside a single process, SuperClassic offers some benefits as |
| 22 |
compared with the regular Classic: |
| 23 |
|
| 24 |
* Less OS kernel resources are used (e.g. desktop heap on Windows), it should |
| 25 |
allow better scalability in terms of a number of user attachments |
| 26 |
|
| 27 |
* Better performance due to the local calls (instead of IPC) inside the lock |
| 28 |
manager and other in-process optimizations |
| 29 |
|
| 30 |
* Server can be safely shutdown as a whole, all active attachments are gracefully |
| 31 |
disconnected |
| 32 |
|
| 33 |
* It's possible to enumerate attached databases and users via the Services API |
| 34 |
|
| 35 |
* Security database attachment is shared, thus allowing faster user connections |
| 36 |
|
| 37 |
The drawbacks are the following: |
| 38 |
|
| 39 |
* Somewhat ineffective memory usage (same as for Classic) |
| 40 |
|
| 41 |
* High lock table contention (due to page locks), so it requires careful tuning |
| 42 |
the lock manager configuration (again, same as for Classic) |
| 43 |
|
| 44 |
* Server crash affects all user attachments (same as for SuperServer) |
| 45 |
|
| 46 |
* It doesn't make much sense on 32-bit systems, because the total page cache size |
| 47 |
(for all attachments) must fit the 2GB process address space limit |
| 48 |
|
| 49 |
Please note that SuperClassic opens the database file in the shared mode, allowing |
| 50 |
other Classic, SuperClassic or Embedded processes to access the database file at the |
| 51 |
same time. |
| 52 |
|
| 53 |
On Windows, SuperClassic shares the same binary fb_inet_server.exe with Classic. |
| 54 |
A new command line switch -m (multi-threaded) should be used for fb_inet_server.exe |
| 55 |
to start SuperClassic as an application, or for instsvc.exe to install SuperClassic |
| 56 |
as a service. |
| 57 |
|
| 58 |
On POSIX, a new binary fb_smp_server is introduced to run the server in the |
| 59 |
SuperClassic mode. It should be installed as a system daemon, [x]inetd is not required. |