4.2 Server config
- Specify your own server info, it’ll be /*Artanis-x.x.x/* in default, depends on the version.
server.nginx = enable | disable
- If you used Nginx as the reversed-proxy, please enable it.
server.charset = <string>
- Charset in server side. utf-8 in default.
- Note: Don’t change it unless you know what you’re doing!
server.syspage.path = /etc/artanis/pages
- The path of status page. You may customize your own status pages.
server.backlog = <integer>
- Backlog of the socket.
- Note: Don’t change it unless you really know what you’re doing!
- The length of the work queue in Artanis server.
- Note: Added since Artanis-0.2.
server.trigger = edge | level
- The trigger mode of epoll.
- Note: Added since Artanis-0.2.
server.engine = ragnarok | guile | fibers | <customized engine>
- The server core which is used for holding high concurrent connections. Artanis has a strong server core named Ragnarok
which is based on delimited continuations to provide asynchronous non-blocking high concurrent serving.
- You may choose guile inner server which is weak, but sometimes you may under an operating system lacking of key features
to run Raganrok, for example, maybe there’s no epoll in your Operating System, for example, GNU/Hurd.
- You may choose fibers server implemented with threads and delimited continuations, which is preemptable by the timer you set.
For more details please see Fiber Manual.
- Note: Added since Artanis-0.2.
- Note: Fibers is supported since Artanis-0.2.5.
server.polltimeout = <integer>
- The the timeout for each event polling round, in miliseconds.
- The default value is 500 miliseconds.
- Note: Added since Artanis-0.2.
server.bufsize = <integer>
- The buffer size of the connecting socket. In Ragnarok, the request handling will be scheduled when the
socket buffer is full. This item effects the performance of socket I/O largely. Usually, if you’re handling
massive small requests, it’s better to set the buffer size small; but if you’re providing kind of downloading
or uploading service, it’s better to set it larger. But the large buffer size will increase the latency of
unserved requests. Please read Ragnarok chapter to learn the design principle, which will be helpful for you
to decide how to tweak.
- The default value is 12288, say, 12KB.
- Note: Added since Artanis-0.2.
- This is the most significant feature of Ragnarok. Please remember that there’s no any thread in GNU Artanis.
All the tasks are based on delimited continuations, this kind of design is the so-called Green Threads.
Then how to take advantage of multi-cores? Fortunately, GNU/Linux has introduced a feature named SO_REUSEPORT since 3.9.
This feature let us start multiple Artanis instances listenning on the same socket port. When requests come, the
Linux kernel will do necessary lock and allocation work for us to dispatch requests to these Artanis instances.
This makes GNU Artanis provide performance and stateless perfectly.
- The default value is true.
- Note: Added since Artanis-0.2, GNU/Linux-3.9+ is required.