OSCam/en/Loadbalancing: Unterschied zwischen den Versionen

Aus Streamboard Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „Kategorie:OSCam {{OSCamHomeLinks}} text-bottom '''Attention:''' The content of the english pages are partially still in german. Please...“)
 
(Removed the German language warning.)
 
(2 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
[[Kategorie:OSCam]]
[[Kategorie:OSCam]]
{{OSCamHomeLinks}}
{{OSCamHomeLinks}}
[[Datei:WarningS.png|text-bottom]] '''Attention:''' The content of the english pages are partially still in german. Please register here to help us completing and translating the articles.


== Loadbalancing ==
== Loadbalancing ==
=== Wie funktioniert der Loadbalancer? ===
=== How does it work? ===
Wenn man auf ein verschlüsseltes Programm schaltet, muß OSCam eine dem Programm entsprechende Karte finden, die sich hinter einem Reader befindet.
In networking, load balancing is a technique to distribute workload evenly across two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, maximize throughput, minimize response time, and avoid overload.
Es wird also ein ECM request an einen gültigen Reader geschickt.
 
Nach folgenden Bedingungen lernt der Loadbalancer, welche srvids (Programme) auf welchen readern zu Verfügung stehen.


[http://upload.wikimedia.org/wikipedia/commons/c/c5/Lb_weight_calc2.png Übersicht lb_weight werte]
In OSCam, load balancing is the algorithm used to determine which of the configured readers should be used to serve an ECM request.


=== Wie ermittelt OSCam einen gültigen Reader? ===
Each reader starts off with a given weight (default: 100), as specified in the configuration.
Für jeden ECM Request werden zuerst die gültigen reader ermittelt.
Dies geschieht durch:
* Gruppe des account passt zu Gruppe reader
* reader ist enabled und nicht gelöscht
* reader caids passen zu ECM request oder reader hat keine caids
* reader services passen zu ECM request oder reader hat keine services
* reader idents passen zu ECM request oder reader hat keine idents
* reader chids passen zu ECM request oder reader hat keine chids
* bei caid 0500 zusätzliche Prüfung auf nanos


Wenn all diese Prüfungen positiv sind, dann wird der reader für diesen ECM Request ausgewählt. Diese Prüfung wird für alle Reader durchgeführt und der Loadbalancer erhält so eine Liste alle möglichen reader für diesen ECM Request.
[[Datei:Lb_weight_calc2.png]]


Ist nun der loadbalancer aktiviert, so ermittelt er aus dieser Menge die Loadbalancer Werte (LB_WERT).  
=== How does OSCam determine a valid reader? ===
For each ECM request, the server determines the valid readers.
This is how it's done:
* The group of the account matches the group of the reader
* The reader is enabled and not deleted
* The caid of the ECM request matches the caid of the reader or the reader has no caid specified
* The service of the ECM request matches the service of the reader or the reader has no service specified
* The ident of the ECM request matches the ident of the reader or the reader has no ident specified
* The chid of the ECM request matches the chid of the reader or the reader has no chid specified
* If the caid is 500, additional checks are done on nanos


Für jeden Reader (aus der Liste der gültigen) wird dann der LB_WERT ermittelt, indem
If a reader passes all these checks, then the reader can serve the ECM request. All configured readers are validated, thus building a list of all readers that could serve the ECM request. Load balancing is the algorithm used to determine which reader is selected to serve the request, out of the list of possible readers.


lb_mode=1: die durchschnittliche Antwortzeit des readers für diesen service durch das lb_weight geteilt wird.
The selection is done based on the load balancing ''weights'' (LB_WERT). For each valid reader, the LB_WERT value is calculated as follows:


lb_mode=2: die Letzte Antwortzeit relativ zur frühesten Antwortzeit gemessen wird.
For lb_mode=1, the weight for a reader is divided by the average response time of requests sent to the reader, i.e. lower average response time means higher priority.


lb_mode=3: das usagelevel (Idlezeit im Verhältnis der ECM-Verarbeitungszeit) gemessen wird.
For lb_mode=2, the weight for a reader depends on when the reader was last used, i.e. oldest reader has higher priority.


Die ermittelten Reader werden dann nach diesem LB_WERT sortiert (kleinster zuerst) und zugeordnet:
For lb_mode=3, the weight for a reader is proportional with the usage level of the reader, i.e. least used reader has higher priority.
* Ist "Prefer local cards" aktiviert, werden zuerst lb_nbest Reader zugeordnet, die keine Proxies sind
* Ist lb_nbest Reader noch nicht erreicht, so werden die verbleibenden Reader der reihe nach zugeordnet, bist lb_nbest Reader erreicht ist.
* Danach werden lb_nfb Reader als Fallback-Reader zugeordnet


Normalerweise sollte lb_nbest readers = 1 sein, da es nicht notwendig ist, mehr als einen reader anzufragen.  
The possible readers are sorted by the computed LB_WERT values (smaller first), and the reader is selected as follows:
* If "Prefer local cards" is selected, the first lb_nbest number of readers are selected, which are not proxies.
* If we haven't selected lb_nbest readers yet, the remaining readers are assigned in sequence, until lb_nbest readers are reached.
* After selecting lb_nbest readers, the fallback readers are assigned (lb_nfb).


Nebenbedinungen, die zusätzlich Reader auswählen:
Normally, lb_nbest = 1, because it's sufficient to query only one reader.
* Keine Statistik vorhanden: Reader wird ausgewählt
* Statistik vorhanden aber lb_min_ECMcount nocht nicht erreicht: Reader wird ausgewählt
* Statistik vorhanden, ECM Anzahl > lb_max_ECMcount: Reader wird ausgewählt, wenn durchschnittliche Antwortzeit > lb_retrylimit und die Stats werden resetet.


Der ECM Request wird dann ausgeführt und an die entsprechenden reader geschickt.
Additional readers can be selected:
* If no statistics are available, the reader is selected.
* If statistics are available, but lb_min_ECMcount has not been reached yet, then the reader is selected.
* Statistics are available, ECM request count > lb_min_ECMcount, then the reader is selected if the average response time is greater than lb_retrylimit and the statistics are reset.


The ECM request is sent to all the appropriate readers.


'''Antwortet ein Reader mit "not found", so wird dieser geblockt.'''
'''If a reader answers with "not found", then it gets blocked.'''


'''Antwortet ein Reader 5x nacheinander nicht auf ECM-Requests (timeout), so wird dieser geblockt.''' (siehe lb_min_ecmcount)
'''If a reader times out 5 times successively on ECM requests, then it gets blocked.''' (see lb_min_ecmcount)


'''Antwortet ein Reader korrekt, so wird dessen Zeit für die Antwort gemessen und in die Statistik eingetragen.'''
'''If the reader responds correctly, then the response time is measured and added to the statistics.'''


'''Sind Service oder Ident vorhanden, werden ECM-Requests für die zugeordneten Reader immer ausgeführt.'''
'''If service or ident are present, ECM requests for the assigned readers are always implemented.'''




{{OSCamTranslatedLinks}}
{{OSCamTranslatedLinks}}

Aktuelle Version vom 16. März 2011, 02:12 Uhr

OSCam Übersicht OSCam Home OSCam Accueil OSCam Home

Loadbalancing

How does it work?

In networking, load balancing is a technique to distribute workload evenly across two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, maximize throughput, minimize response time, and avoid overload.

In OSCam, load balancing is the algorithm used to determine which of the configured readers should be used to serve an ECM request.

Each reader starts off with a given weight (default: 100), as specified in the configuration.

How does OSCam determine a valid reader?

For each ECM request, the server determines the valid readers. This is how it's done:

  • The group of the account matches the group of the reader
  • The reader is enabled and not deleted
  • The caid of the ECM request matches the caid of the reader or the reader has no caid specified
  • The service of the ECM request matches the service of the reader or the reader has no service specified
  • The ident of the ECM request matches the ident of the reader or the reader has no ident specified
  • The chid of the ECM request matches the chid of the reader or the reader has no chid specified
  • If the caid is 500, additional checks are done on nanos

If a reader passes all these checks, then the reader can serve the ECM request. All configured readers are validated, thus building a list of all readers that could serve the ECM request. Load balancing is the algorithm used to determine which reader is selected to serve the request, out of the list of possible readers.

The selection is done based on the load balancing weights (LB_WERT). For each valid reader, the LB_WERT value is calculated as follows:

For lb_mode=1, the weight for a reader is divided by the average response time of requests sent to the reader, i.e. lower average response time means higher priority.

For lb_mode=2, the weight for a reader depends on when the reader was last used, i.e. oldest reader has higher priority.

For lb_mode=3, the weight for a reader is proportional with the usage level of the reader, i.e. least used reader has higher priority.

The possible readers are sorted by the computed LB_WERT values (smaller first), and the reader is selected as follows:

  • If "Prefer local cards" is selected, the first lb_nbest number of readers are selected, which are not proxies.
  • If we haven't selected lb_nbest readers yet, the remaining readers are assigned in sequence, until lb_nbest readers are reached.
  • After selecting lb_nbest readers, the fallback readers are assigned (lb_nfb).

Normally, lb_nbest = 1, because it's sufficient to query only one reader.

Additional readers can be selected:

  • If no statistics are available, the reader is selected.
  • If statistics are available, but lb_min_ECMcount has not been reached yet, then the reader is selected.
  • Statistics are available, ECM request count > lb_min_ECMcount, then the reader is selected if the average response time is greater than lb_retrylimit and the statistics are reset.

The ECM request is sent to all the appropriate readers.

If a reader answers with "not found", then it gets blocked.

If a reader times out 5 times successively on ECM requests, then it gets blocked. (see lb_min_ecmcount)

If the reader responds correctly, then the response time is measured and added to the statistics.

If service or ident are present, ECM requests for the assigned readers are always implemented.


Diese Seite in anderen Sprachen - This page in other languages - Cette page dans d'autres langues - Queste pagine in altre Lingue

[[OSCam/de/{{#titleparts:OSCam/en/Loadbalancing|3|3}}|Deutsch]] [[OSCam/en/{{#titleparts:OSCam/en/Loadbalancing|3|3}}|English]] [[OSCam/fr/{{#titleparts:OSCam/en/Loadbalancing|3|3}}|Français]] [[OSCam/it/{{#titleparts:OSCam/en/Loadbalancing|3|3}}|Italiano]]