Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load balancing #5

Closed
krizhanovsky opened this issue Sep 6, 2014 · 3 comments
Closed

Load balancing #5

krizhanovsky opened this issue Sep 6, 2014 · 3 comments

Comments

@krizhanovsky
Copy link
Contributor

Following sched modules must be implemented:

  • round-robin
  • by list of statically specified URL, Host or backed IP addresses (i.e. each backend server must have it's own list of URLs and/or Host values (or IP addresses instead of DNS names) by which are sent to it). This is very similar to location based load balancing of Nginx;
  • by hash calculated on URI, Host HTTP header or client IP

See Nginx load balancing as an example.

The system must ensure that only one shceduler module can be loaded by a user.

Tempesta must add X-Forwarded-For HTTP header with the client IP address to forwarded to backed server request.

Failovering over backend nodes also must be implemented. See HAProxy

@krizhanovsky krizhanovsky mentioned this issue Sep 18, 2014
vdmit11 added a commit that referenced this issue Sep 25, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 1, 2014
1.Add new functions for comparing TfwStr with ANSI strings.

2. Extract TfwStr code to a separate .c file and cover it with unit
tests.

related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 1, 2014
- Scheduler modules are moved to sub-directories to group their files.
- tfw_sched_match implements "prefix" and "equal" comparisons.
- tfw_sched_match has a sysctl interface with a tiny config parser.

Related to task:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 2, 2014
Related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 3, 2014
vdmit11 added a commit that referenced this issue Oct 8, 2014
1.Add new functions for comparing TfwStr with ANSI strings.

2. Extract TfwStr code to a separate .c file and cover it with unit
tests.

related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 8, 2014
- Scheduler modules are moved to sub-directories to group their files.
- tfw_sched_match implements "prefix" and "equal" comparisons.
- tfw_sched_match has a sysctl interface with a tiny config parser.

Related to task:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 8, 2014
Related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 8, 2014
vdmit11 added a commit that referenced this issue Oct 8, 2014
vdmit11 added a commit that referenced this issue Oct 8, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 8, 2014
vdmit11 added a commit that referenced this issue Oct 8, 2014
vdmit11 added a commit that referenced this issue Oct 8, 2014
vdmit11 added a commit that referenced this issue Oct 8, 2014
vdmit11 added a commit that referenced this issue Oct 8, 2014
This large commit is combined from a series of previous small commits
that contain basic implementation for tfw_sched_http - the new
rule-based scheduler.

Changes overview:
 - Add simple unit testing framework.
   Tests run in kernel space in a separate module 'tfw_test'.
 - Extract TfwStr to a separate unit, implement matching functions,
   cover them with unit tests.
 - Extract TfwAddr to a separate unit, lib.c doesn't exist anymore.
 - Add http_match.c - the HTTP Request matching logic.
 - Add tfw_sched_http.c - the rule-based scheduler.

related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 8, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 8, 2014
vdmit11 added a commit that referenced this issue Oct 9, 2014
vdmit11 added a commit that referenced this issue Oct 10, 2014
vdmit11 added a commit that referenced this issue Oct 10, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 12, 2014
related to: #5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 13, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 13, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 13, 2014
vdmit11 added a commit that referenced this issue Oct 13, 2014
vdmit11 added a commit that referenced this issue Oct 14, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 15, 2014
related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 21, 2014
Related to:
#5 - Load balancing
vdmit11 added a commit that referenced this issue Oct 21, 2014
@vdmit11
Copy link
Contributor

vdmit11 commented Nov 13, 2014

TBD:

  1. Add the X-Forwarded-For header to requests.
  2. finish the "failover" branch.
    The failover implies that there will be more than a single connection per client/server.
    There are some simple architectural changes required, in particular:
    1. TfwSession should link TfwConnection objects instead of TfwClient and TfwServer.
    2. TfwServer should contain a pool of connections instead of just one connection.
      Partially they are done, but now there are some circular dependencies (TfwConnection depends on TfwClient and vise versa), they should be solved before finishing the issue.

vdmit11 added a commit that referenced this issue Nov 25, 2014
The change introduces a small set of parallel connections to each
TfwServer. They are switched in a round-robin manner when a message
is scheduled. When a connection is closed, another is chosen and the
closed one is re-connected in background.

Also many connections per server implies that TfwSession doesn't link
TfwClient and TfwServer anymore. Instead, it links client/server sockets.

Related to: #5 - load balancing
vdmit11 added a commit that referenced this issue Dec 2, 2014
The commit introduces two major things:
1. The HTTP parser is now able to parse the X-Forwarded-For header and
   put it to the headers table, although t doesn't parse IP addresses
   or distinct Node IDs yet.
2. Client's IP address is added to X-Forwarded-For header of each
   forwarded HTTP request. If there is no such header - it is created,
   if it is already there, then the client's IP is appended to the list.

Also the commit contains fixes for the HTTP parser that used to crop
parsed HTTP headers and write them into each other's locations in the
headers table.

Related to: #5 - Load Balancing
vdmit11 added a commit that referenced this issue Dec 10, 2014
The commit introduces two major things:
1. The HTTP parser is now able to parse the X-Forwarded-For header and
   put it to the headers table, although t doesn't parse IP addresses
   or distinct Node IDs yet.
2. Client's IP address is added to X-Forwarded-For header of each
   forwarded HTTP request. If there is no such header - it is created,
   if it is already there, then the client's IP is appended to the list.

Also the commit contains fixes for the HTTP parser that used to crop
parsed HTTP headers and write them into each other's locations in the
headers table.

Related to: #5 - Load Balancing
@krizhanovsky
Copy link
Contributor Author

tfw_sched_hash must be updated by Rendezvous hashing (http://en.wikipedia.org/wiki/Rendezvous_hashing) for backend servers failover.

@krizhanovsky
Copy link
Contributor Author

It seems this part of the task "Failovering over backend nodes also must be implemented. See HAProxy" is not implemented. We need backup nodes in HAProxy terms WAF installations. The typical installation is Tempesta balances traffic among WAF servers and does preliminary filtering and the whole cluster DDoS protection. WAF nodes do high-level heavy weight filtering and pass the traffic to web servers. However, if WAF nodes fail, then Tempesta must bypass traffic directly to backend Web-servers, but it must not send any traffic to the servers in normal circumstances.

@krizhanovsky krizhanovsky added this to the 0.3.0 Proxy Filter milestone Mar 11, 2015
@vdmit11 vdmit11 mentioned this issue Mar 14, 2015
const-t added a commit that referenced this issue Dec 30, 2022
Removed pfl optimization __lookup_pgfrag_room

After analyzing perfstat and benchmarks we came to the conclusion,
that pfl not working as expected and looks like overengineering.

The most optimistic case of observer results(Response 128KB):
SS pfl hits	: 2969144
SS pfl misses	: 3944903

* Removed pfl statistics

* Added patch from PR #5 and removed unnecessary initializations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants