Information
This article contains information about the NetScaler Compression feature.
Background
The compression feature in a NetScaler appliance enables a NetScaler server to compress HTTP responses to compression-aware browsers. Virtually all current Web browsers are able to translate compressed HTTP data.
Initially, an administrator can see if compression is enabled through configurable policies by running the show ns feature command from the NetScaler Command Line Interface (CLI), or verify the GUI administration tool. Examples of each of these methods are in the following screen shots:
`
A NetScaler server is configured to compress text in HTML, XML, plain text, CSS (Cascading Style Sheets), and Microsoft Office documents. NetScaler appliance does not compress images in GIF or JPG format. The major benefits of compressed traffic include reduced bandwidth costs, WAN latency reduction, and better server performance. There are many other benefits, and you can research these in various Marketing and Technical NetScaler documents.
NetScaler Compression Function
The NetScaler compression feature is based on GZIP/deflate-compatible compression (RFCs 1950/1951/1952). NetScaler compression can compress HTML data at a rate of about 3:1, depending on the type of data being compressed. Data with heavy formatting compresses well. Compression ratios, however, are not linear with data size.
Using COMPRESS and NO COMPRESS command line actions, NetScaler Administrators can define compression policies to enable or disable compression of specific types of responses. You can see this in the preceding screen shot. Responses that are sent back to clients are compressed, not requests.
Virtually all current NetScaler customers using the compression feature have compression enabled in Inline mode, which basically indicates that compression runs at the NetScaler server that is acting as a network traffic manager. At the highest level, server responses are checked by the NetScaler traffic manager server to see if they contain data that can be compressed. If the data can be compressed, the NetScaler compression engine first compresses the data, and then modifies the response header to indicate the type of compression completed. The data is then forwarded to the client. The following diagram is an example of an inline compression environment setup:
Alternatively, compression can be enabled on non traffic-manager NetScaler servers. This method requires the customer to purchase several NetScaler servers. Therefore, the NetScaler traffic manager server forwards the compression work to NetScaler servers set up as pure compression accelerators. The compression engine(s) on these servers then handle compression duties. The following diagram illustrates an example of this environment:
To set up this type of compression environment, compression is first configured on the NetScaler server acting as the traffic manager, and then it is set up on the NetScaler server acting as a pure accelerator.
Commands Used to Set Up Compression
To set up compression at the service level, run the set service command as follows:
set service <servicename> -cmp YES
When you configure a NetScaler appliance to perform inline compression, run the following commands from the CLI of the appliance to complete the following actions:
-
Run the following command to enable both compression and load balancing feature:
enable ns feature lb cmp -
Run the following commands to add HTTP services:
add service cmpsvc_1 10.101.2.23 HTTP 80
add service cmpsvc_2 10.101.2.24 HTTP 80 -
Run the following command to define a virtual server for the load balancing:
add lb vserver http_lb HTTP 10.101.2.106 80 -
Run the following command to bind the services to the load balancing virtual server.
bind lb vserver http lb cmpsvc_1
bind lb vserver http_lb cmpsvc_2
When you configure a NetScaler appliance to perform compression on a dedicated NetScaler compression server, run the following commands from the CLI to complete the following tasks. The actual commands are dependent on SSL being configured or not. This article focuses on SSL enabled virtual servers.
-
Run the following commands to configure the NetScaler server acting as the network traffic manager:
enable ns feature ssl lb cs
add cs vserver vip_origin SSL 10.101.2.25 443
add lb vserver cmp lb HTTP
add lb vserver http_lb HTTP 10.101.2.28 80
add service cmp_1 10.101.2.40 HTTP 80
add service cmp_2 10.101.2.42 HTTP 80
bind lb vserver cmp_lb cmp1
bind lb vserver cmp_lb cmp2
add service svr_1 10.101.2.50 HTTP 80
add service svr_2 10.101.2.52 HTTP 80
bind lb vserver http_lb svr_1
bind lb vserver http_lb svr_2
add?? expression html_expr URL EQ "/*.html”
add expression asp_expr URL EQ "/*.asp"
add cs policy cmp_pol -rule ns_cmpc1ient &&
(html_expr || asp_expr)”
bind cs vserver vip_origin cmp_lb -policyname cmp_pol
bind cs vserver vip_origin http_lb
add certkey cert1 -cert /var/cert/certificate.pem
-key /var/cert/key.pem
bind certkey vip_origin cert1 -
Run the following command to configure the NetScaler server acting as a compression accelerator:
enable ns feature lb cmp
add lb vserver cmp_1 HTTP 10.101.2.40 80
add service http_lb 10.101.2.28 HTTP 80
bind lb vserver cmp_1 http_lb -
If an environment has more than one compression accelerator NetScaler server configured (like the image above), run the following commands to configure the additional servers the same way you did the first, with the only difference being the name of the compression accelerator virtual server:
enable ns feature lb cmp
add lb vserver cmp_1 HTTP 10.101.2.40 80
add service http_lb 10.101.2.28 HTTP 80
bind lb vserver cmp_1 http_lb
Compression Policies
Compression policies can be configured to set conditions under which compression is preformed. By default, NetScaler appliance enables several policies when you enable compression at a global level. These policies can also be set to specific virtual servers.
To see what compression policies are set on the NetScaler appliance, run the show cmp global command from the CLI?? as displayed in the following screen shot: the description for each one of these policies is also detailed.
Run the show cmp policy command to view all configured compression policies.
ns_nocmp_mozilla_4
This policy causes the NetScaler appliance not to compress CSS files when the request comes from the Mozilla Web browser.
ns_cmp_mscss
This policy causes the NetScaler appliance to compress CSS files when the request comes from Microsoft Internet Explorer.
ns_cmp_msapp
This policy causes the NetScaler appliance to compress files generated by the following Microsoft applications:
-
Microsoft Office Word
-
Microsoft Office Excel
-
Microsoft Office PowerPoint
ns_cmp_content_type
This policy causes the NetScaler appliance to compress text using the GZIP algorithm.
> show cmp policy 5 Compression policies: 1) Name: ns_cmp_content_type Rule: ns_content_type Response action: COMPRESS Hits: 0 2) Name: ns_cmp_msapp Rule: (ns_msie && ns_msword || (ns_msexcel || ns _msppt)) Response action: COMPRESS Hits: 0 3) Name: ns_cmp_mscss Rule: (ns_msie && ns_css) Response action: COMPRESS Hits: 0 4) Name: ns_nocmp_mozilla_47 (ns_mozilla_47 && ns_css) Response action: NOCOMPRESS Hits: 0 5) Name: ff1 Rule: (REQ.HTTP.URL == /testsite/ file5.html && RES.HTTP. HEADER Server EXISTS) Response action: GZIP Hits: 0 Done
Configuring Customized Compression Policies
It is possible to also create custom policies using expressions and actions. The four compression actions a NetScaler appliance can perform are COMPRESS, NOCOMPRESS, GZIP, and DEFLATE. Custom policies can be made from both the GUI and the CLI. Using the GUI to complete this avoids the majority of possible syntax errors.
COMPRESS – When this action is selected, the NetScaler appliance uses the GZIP algorithm to compress data.
NOCOMPRESS – When this action is selected, the NetScaler appliance does not compress data.
GZIP – Same as COMPRESS.
DEFLATE – When this action is selected, the NetScaler appliance uses the DEFLATE algorithm to compress data.
Supporto Citrix
Traduzione automatica
Questo articolo ?? ¨ stato tradotto da un sistema di traduzione automatica e non ?? ¨ stata valutata da persone. Citrix fornisce traduzione automatica per aumentare l'accesso per supportare contenuti; tuttavia, articoli automaticamente tradotte possono possono contenere degli errori. Citrix non ?? ¨ responsabile di incongruenze, errori o danni derivanti dell'uso di articoli automaticamente tradotte.
Citrix技術支持
自動翻譯
這篇文章被翻譯由一個自動翻譯系統,並沒有受到人們的審查。 Citrix提供自動翻譯,增加獲得支持的內容;但是,自動翻譯的文章可能可以包含錯誤。思傑不負責不一致,錯誤或損壞因使用自動翻譯的文章的結果。
Поддержка Citrix
Tradução automática
Эта статья была переведена автоматической системой перевода и не был рассмотрен людьми. Citrix обеспечивает автоматический перевод с целью расширения доступа для поддержки контента; Однако, автоматически переведенные статьи могут может содержать ошибки. Citrix не несет ответственности за несоответствия, ошибки, или повреждения, возникшие в результате использования автоматически переведенных статей.
시트릭스 지원
자동 번역
이 문서 자동 번역 시스템에 의해 번역 된 사람들에 의해 검토되지 않았다. 시트릭스는 컨텐츠를 지원하기 위해 접근을 높이기 위해 자동 번역을 제공합니다; 그러나, 자동으로 번역 기사 오류를 포함 할 수있다. 시트릭스는 자동으로 번역 된 기사의 사용의 결과로 발생하는 불일치, 오류 또는 손해에 대해 책임을지지 않습니다.