NODE Section

The NODE section configures each node that composes WebtoB. This section affects all operations related to the node.

The NODE section can define 'WebtoB system path' and 'other system configuration'.

Configuration Items

The following is the configuration format of the NODE section.

"node": {
    "name": string
    "hth_count": integer,                        # 1 (1-255)
    #"worker_threads": integer,                  # 8 (1-100)
    #"hth_schedule": string,                     # "RR"
    #"connection_pool_size": integer,            # 8192 (1-INT_MAX)
    #"graceful_shutdown_timeout": integer        # 30 (1-INT_MAX)
    #"cache_key": string,                        # "HOST_URI"
    #"cache_entry": integer                      # 128 (0-INT_MAX)
    #"max_cache_memory_size": integer            # 100 (0-INT_MAX)
    #"cache_max_file_size": integer              # 8192 (0-INT_MAX)
    #"listen_backlog": integer                   # 4096 (0-INT_MAX)
    #"limit_request_body_size": integer          # 0 (0-INT_MAX)
    #"limit_request_header_field_count": integer # 100 (0-INT_MAX)
    #"limit_request_header_field_size": integer  # 8190 (0-INT_MAX)
    #"limit_request_line_size": integer          # 8190 (0-INT_MAX)
    #"system_filters": [string]
}

Refer to Types of Setting Values and Configuration Methods for more information on symbols and details of the NODE section configuration items.

name (Required)

Specifies the node name.

Item Description

Data Type

String

Range

Up to 127 characters

The following an example of setting the name. If the prompt displays 'user@webtob_node:~$', set the name as follows.

"node": {
    "name": "webtob_node",
    ...
}

The node name must be the same as the host name. If it is different, it cannot be run.

hth_count

Specifies the number of HTTP handlers (HTH).

Item Description

Data Type

Integer

Range

1 ~ 100

Default Value

1

The following is an example of the hth_count configuration. If 'hth_count' is set to 3 as follows, 'HTH-0', 'HTH-1', and 'HTH-2' will be created.

"node": {
    "name": "webtob_node",
    "hth_count": 3,
    ...
}

You can check the generated HTH through the log (webtob.log).

EventManager(HTH-2) Thread Created. Thread ID: 4800

worker_threads

Sets the number of worker threads to assign to HTH. Worker threads process static files, SSL/TLS (handshake, encryption, and decryption), compression, and HTTP authentication.

Item Description

Data Type

Integer

Range

1 ~ 100

Default Value

8

The following is an example of the worker_threads configuration. If 'worker_threads' is set to 5 as follows, 'HTMLS-0', 'HTMLS-1', 'HTMLS-2', 'HTMLS-3', and 'HTMLS-4' will be created.

"node": {
    "name": "webtob_node",
    "hth_count": 3,
    "worker_threads":5,
    ...
}

You can check the created worker thread through the log (webtob.log).

EventManager(HTMLS-4) Thread Created. Thread ID: 19271

Since the number of FDs used equals hth_count × worker_threads, you must consider the number of FDs when configuring hth_count and worker_threads. If the set value exceeds the number of FDs, the server will shut down and an error log occurs as follows:

Error: eventFd() failed: Too many open files
Too many open files

hth_schedule

Specifies the method to specify the HTH to process the request when there are multiple HTHs.

Item Description

Data Type

String

Range

"RR"

Default Value

"RR"

The following describes each configuration value.

Value Description

RR

Assigns requests to HTHs sequentially using the round robin method.

The following is an example of setting hth_schedule:

"node": {
    "name": "webtob_node",
    "hth_count": 2,
    "worker_threads":8,
    "hth_schedule": "RR",
    ...
}

You can check in the webtob.log file that requests are assigned sequentially based on the number set in hth_count.

[2024-07-25 06:49:19.113263413][DEBUG][HTH-0][SVR_3455]WJP2RequestMessageHandler.cpp:87 serviceMessage: WJP Request Loop Done.
[2024-07-25 06:49:19.113268083][DEBUG][HTH-0][NET_2004]EventManager.cpp:129 loop: End of this loop.
[2024-07-25 06:49:19.425343033][DEBUG][HTH-1][NET_4000]EpollMultiplexer.cpp:33 select: Multiplexer awakened. Event Count=0.
[2024-07-25 06:49:19.425360647][DEBUG][HTH-1][NET_2004]EventManager.cpp:129 loop: End of this loop.
[2024-07-25 06:49:20.114399067][DEBUG][HTH-0][NET_4000]EpollMultiplexer.cpp:33 select: Multiplexer awakened. Event Count=0.
[2024-07-25 06:49:20.114416261][DEBUG][HTH-0][NET_2004]EventManager.cpp:129 loop: End of this loop.
[2024-07-25 06:49:20.426438758][DEBUG][HTH-1][NET_4000]EpollMultiplexer.cpp:33 select: Multiplexer awakened. Event Count=0.
[2024-07-25 06:49:20.426456148][DEBUG][HTH-1][NET_2004]EventManager.cpp:129 loop: End of this loop.

connection_pool_size

Sets the size of the pool that manages connections for each HTH.

Item Description

Data Type

Integer

Range

1 ~ INT_MAX

Default Value

8192

Similar to hth_count and worker_threads, this setting is affected by the number of FDs, so the number of FDs must be considered. If the set value exceeds the number of FDs, the following error will occur and the server will shut down.

Error: eventFd() failed: Too many open files
Too many open files

graceful_shutdown_timeout

Sets a timeout to wait before forcing a shutdown after a graceful shutdown command.

Item Description

Data Type

Integer

Unit

seconds

Range

1 ~ INT_MAX

The following is an example of setting graceful_shutdown_timeout:

{
  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "graceful_shutdown_timeout":5
  },
  ...

cache_key

Sets the format of the key used to identify cached data.

Item Description

Data Type

String

Range

"HOSTS" | "REAL_PATH"

Default Value

"HOST_URI"

The following describes each configuration value.

Value Description

HOST_URI

Use the request URI and the HOST value of the request header to create a Key.

Even if REQUEST_URI is the same, the VHOST depends on HTTP_HOST. This means that the actual path can be different. Although VHOST is different, the same actual path can cause duplicate caching.

The response is faster than using REAL_PATH because the real path does not need to be calculated. Therefore, if DocRoot differs by VHOST, it is better to use the HOST_URI.

Since responses handled by JEUS or Reverse Proxy cannot be calculated, HOST_URI value is used.

REAL_PATH

Uses the actual path of the request URI to generate a Key. This value is applied only when SVRTYPE is HTML and helps to address potential issues that may occur when using HOST_URI.

Even if the HTTP_HOST is different, the actual path of the same requested file may be the same. In this case, only one file is cached regardless of the HTTP_HOST, which can reduce memory usage. However, since the actual path needs to be calculated, the response time may be slightly slower than using HOST_URI.

The following is an example of setting cache_key. To store the cache, 'enable_cache' must be set to true in the destination section.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "cache_key":"HOST_URI",
    "cache_entry":128,
    "max_cache_memory_size":100,
    "cache_max_file_size":8192
    ...
    "destination": {
      "htmls": [
      {
        "name": "htmls1",
        "enable_cache":true
      }
    ...

The cache status can be checked in the wsadmin’s cache-list. If the cache_key setting value is 'HOST_URI', it will be displayed as 192.168.0.1:80/image.jpg, and if it is 'REAL_PATH', it will be displayed as /home/tmax/webtob6/docs/image.jpg.

[wsadmin]>> cache-list
------------------------------------------------------------------
| HTH-0: Cache List Info                                         |
------------------------------------------------------------------
|          Cache key          |    Expired time     | Cache size |
------------------------------------------------------------------
| 192.168.0.1:80/image.jpg | 2024-01-01 00:00:00 |         300|
------------------------------------------------------------------
| Cache count : 1                                                |
| Memory usages : 300                                            |
------------------------------------------------------------------

cache_entry

Sets the size of the hash table Key for the HTH cache.

Item Description

Data Type

Integer

Range

0 ~ INT_MAX

Default Value

128

The following describes each configuration value.

Value Description

0

Does not cache the response.

The following is an example of setting cache_entry. To store the cache, 'enable_cache' must be set to true in the destination section.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "cache_key":"HOST_URI",
    "cache_entry":128,
    "max_cache_memory_size":100,
    "cache_max_file_size":8192
    ...
    "destination": {
      "htmls": [
      {
        "name": "htmls1",
        "enable_cache":true
      }
    ...

The cache status can be checked in the wsadmin’s cache-list. If the cache_entry setting value is 2, a maximum of 2 rows will be displayed.

[wsadmin]>> cache-list
----------------------------------------------------------------------------------
| HTH-0: Cache List Info                                                         |
----------------------------------------------------------------------------------
|                  Cache key                  |    Expired time     | Cache size |
----------------------------------------------------------------------------------
| 192.168.0.1:80/image.jpg | 2024-01-01 00:00:24 |         345|
| 192.168.0.1:80/image1.jpg  | 2024-01-01 00:00:21 |         345|
----------------------------------------------------------------------------------
| Cache count : 2                                                                |
| Memory usages : 1035                                                           |
----------------------------------------------------------------------------------

max_cache_memory_size

Specifies the maximum amount of memory used by a HTH process for caching.

This is not the total memory size used by all HTH processes, but it applies to each HTH process.

Item Description

Data Type

Integer

Unit

Mbytes

Range

0 ~ INT_MAX

Default Value

100

The following describes each configuration value.

Value Description

0

Does not cache the response.

The following is an example of setting max_cache_memory_size. To store the cache, 'enable_cache' must be set to true in the destination section.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "cache_key":"HOST_URI",
    "cache_entry":128,
    "max_cache_memory_size":100,
    "cache_max_file_size":8192
    ...
    "destination": {
      "htmls": [
      {
        "name": "htmls1",
        "enable_cache":true
      }
    ...

The cache status can be checked in the wsadmin’s cache-list. If the max_cache_memory_size setting is 100, the size of images stored in the cache cannot exceed 100 MB.

[wsadmin]>> cache-list
----------------------------------------------------------------------------------
| HTH-0: Cache List Info                                                         |
----------------------------------------------------------------------------------
|                  Cache key                  |    Expired time     | Cache size |
----------------------------------------------------------------------------------
| 192.168.0.1:80/image.jpg | 2024-01-01 00:00:24 |         345|
| 192.168.0.1:80/image1.jpg  | 2024-01-01 00:00:21 |         345|
----------------------------------------------------------------------------------
| Cache count : 2                                                                |
| Memory usages : 1035                                                           |
----------------------------------------------------------------------------------

cache_max_file_size

Specifies the maximum size of a response (headers + body) that can be cached.

Item Description

Data Type

Integer

Unit

bytes

Range

0 ~ INT_MAX

Default Value

8192

The following describes each configuration value.

Value Description

0

Does not cache the response.

The following is an example of setting cache_max_file_size. To store the cache, 'enable_cache' must be set to true in the destination section.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "cache_key":"HOST_URI",
    "cache_entry":128,
    "max_cache_memory_size":100,
    "cache_max_file_size":8192
    ...
    "destination": {
      "htmls": [
      {
        "name": "htmls1",
        "enable_cache":true
      }
    ...

The cache status can be checked in the wsadmin’s cache-list. If the cache_max_file_size setting is 8192, images exceeding 8192 bytes will not be cached.

[wsadmin]>> cache-list
----------------------------------------------------------------------------------
| HTH-0: Cache List Info                                                         |
----------------------------------------------------------------------------------
|                  Cache key                  |    Expired time     | Cache size |
----------------------------------------------------------------------------------
| 192.168.0.1:80/image.jpg | 2024-01-01 00:00:24 |         345|
| 192.168.0.1:80/image1.jpg  | 2024-01-01 00:00:21 |         345|
----------------------------------------------------------------------------------
| Cache count : 2                                                                |
| Memory usages : 1035                                                           |
----------------------------------------------------------------------------------

listen_backlog

Specifies the maximum number of queued pending connections. This limits the number of sockets attempting to access the service port.

Item Description

Data Type

Integer

Range

1 ~ INT_MAX

Default Value

4096

This may be related to the number of sockets in SYN_RECVD state in the netstat command.

The following is an example of the listening_backlog setting.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "listen_backlog":50
    ...

You can check the changed Send-Q using the ss command.

If the listen_backlog setting is set to 511 or higher, the Send-Q value does not exceed 511. This can be adjusted by changing the system value using the 'sysctl -w net.core.somaxconn=[setting value]'.

user@webtob_node:~/tmax/webtob6/$ ss -lnt | grep 80
State  Recv-Q    Send-Q             Local Address:Port    Peer Address:Port
LISTEN   0         50                  0.0.0.0:80           0.0.0.0:*

limit_request_body_size

Specifies the client request body size supported by the server through the HTTP protocol.

If the HTTP request body is 2G (Long type) or larger, it can be processed starting from JEUS version 7 and later.

This value is determined based on the 'Content-Length' value of the HTTP request header, and specifies the maximum body size to allow for chunked requests. If a request body is larger than the set value, the server responds with '413 Request Entity Too Large'.

Item Description

Data Type

Integer

Unit

bytes

Range

0 ~ INT_MAX

Default Value

0

The following describes each configuration value.

Value Description

0

No limit on the request body size.

The following is an example of setting limit_request_body_size.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "limit_request_body_size":100
    ...

If limit_request_body_size is set to 100, the following message is displayed when Content-Length exceeds 100.

* Closing connection 0
The body is too large.

limit_request_header_field_count

Specifies the maximum number of a client request’s HTTP header fields.

Item Description

Data Type

Integer

Range

0 ~ INT_MAX

Default Value

100

The following describes each configuration value.

Value Description

0

No limit on the number of header fields.

The following is an example of setting limit_request_header_field_count.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "limit_request_header_field_count":1
    ...

When limit_request_header_field_count is set to 1, the following message is displayed if the number of header fields exceeds 1.

* Closing connection 0
The number of request header fields exceeds the server limit.

limit_request_header_field_size

Specifies the maximum size of each HTTP header field in a client request.

Item Description

Data Type

Integer

Unit

bytes

Range

0 ~ 16382

Default Value

8190

The following describes each configuration value.

Value Description

0

No limit on the size of header fields.

'WJPv2' must be used for request headers exceeding 10,000 bytes.

The following is an example of setting limit_request_header_field_size.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "limit_request_header_field_size":100
    ...

When limit_request_header_field_size is set to 100, the following message is displayed if the size of each header field exceeds 100.

* Closing connection 0
The size of a request header field exceeds the server limit.

limit_request_line_size

Specifies the maximum size of a client request’s HTTP line.

Item Description

Data Type

Integer

Unit

bytes

Range

0 ~ 16382

Default Value

8190

The following describes each configuration value.

Value Description

0

No limit on the length of the request line.

'WJPv2' must be used for request lines exceeding 10,000 bytes.

The following is an example of setting limit_request_line_size.

  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads":8,
    "limit_request_line_size":100
    ...

If limit_request_line_size is set to 100, the following message is displayed when the length of the request line exceeds 100.

* Closing connection 0
Request Uri too Wrong

system_filters

Sets the filter to be applied when system events (ON_START, ON_STOP) occur.

Item Description

Data Type

Array (string)

Range

Up to 15 items (within 255 characters)

Example

The following is an example of configuring the NODE section.

"node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads": 8,
    "hth_schedule": "RR",
    "connection_pool_size": 8192,
    "graceful_shutdown_timeout": 30,
    "listen_backlog": 4096,
    "cache_key": "HOST_URI",
    "cache_entry": 128,
    "max_cache_memory_size": 100,
    "cache_max_file_size": 8192,
    "limit_request_body_size": 0,
    "limit_request_header_field_count": 100,
    "limit_request_header_field_size": 8190,
    "limit_request_line_size": 8190,
    "system_filters" : [ filter1 ]
}