晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 sh-3ll

HOME


sh-3ll 1.0
DIR:/opt/alt/ruby32/share/gems/gems/ruby-lsapi-5.6/
Upload File :
Current File : //opt/alt/ruby32/share/gems/gems/ruby-lsapi-5.6/README
lsapi - LSAPI extension for Ruby
================================

INSTALL
-------

  $ ruby setup.rb config
  $ ruby setup.rb setup
  # ruby setup.rb install

USAGE
-----

General CGI scripts
^^^^^^^^^^^^^^^^^^^
The most efficient way to use LSAPI interface is to modify your CGI scripts. 
You need to add the following code to your CGI scripts:

  require 'lsapi'
  
  while LSAPI.accept != nil

     <your CGI script>
     ...

  end

There is no need to change the way that how CGI environment variables 
are being accessed in your scripts.

You can find some examples under examples/ folder.


Ruby Script Runner
^^^^^^^^^^^^^^^^^^
If you don't want to change your existing Ruby CGI code, you can use our 
Ruby script runner under scripts/ folder. You need to configure 
lsruby_runner.rb as a LSAPI application, then add a script handler 
for "rb" suffix.



Rails dispatcher
^^^^^^^^^^^^^^^^

With Ruby LSAPI, we proudly provide a optimum platform for Rails application
deployment. Ruby LSAPI has the following advantages over other solutions.

  * Easy configuration, deploy a Rails application only take a few clicks
    with our Rails easy configuration
  * Fast startup, the expensive Rails framework initialization only takes
    place once when multiple processes need to be started
  * Resource efficience, ruby processes can be started on demand, idle
    process will be stop.
    
To use LSAPI with Ruby on Rails, please check out our toturial
http://www.litespeedtech.com/support/wiki/doku.php

There are a few environment variables that can be tweaked to tune ruby 
LSAPI process.

* LSAPI_CHILDREN                (default: 0)

LSAPI_CHILDREN controls the maximum number of children processes can be
started by the first ruby process started by web server. When set to <=1,
the first ruby process will handle request by itself, without starting any
child process. When LSAPI_CHILDREN is >1, the LSAPI application is stared in
"Self Managed Mode", which will start children processes based on demand.
With Rails easy configuration, LSAPI_CHILDREN is set to the value of
"Max Connections" by web server, no need to set it explicitly.

Usually, there is no need to set value of LSAPI_CHILDREN over 100 in most
server environment.


* LSAPI_AVOID_FORK              (default: 0)

LSAPI_AVOID_FORK specifies the policy of the internal process manager in
"Self Managed Mode". When set to 0, the internal process manager will stop
and start children process on demand to save system resource. This is
preferred in a shared hosting environment. When set to 1, the internal
process manager will try to avoid freqently stopping and starting children
process. This might be preferred in a dedicate hosting environment.


* LSAPI_EXTRA_CHILDREN          (default: 1/3 of LSAPI_CHILDREN or 0)

LSAPI_EXTRA_CHILDREN controls the maximum number of extra children processes
can be started when some or all existing children processes are in
malfunctioning state. Total number of children processes will be reduced to
LSAPI_CHILDREN level as soon as service is back to normal.
When LSAPI_AVOID_FORK is set to 0, the default value is 1/3 of
LSAPI_CHIDLREN, When LSAPI_AVOID_FORK is set to 1, the default value is 0.


* LSAPI_MAX_REQS                (default value: 10000)

LSAPI_MAX_REQS specifies the maximum number of requests each child
process will handle before it exits automatically. This parameter can
help reducing memory usage when there are memory leaks in the application. 


* LSAPI_MAX_IDLE                (default value: 300 seconds)

In Self Managed Mode, LSAPI_MAX_IDLE controls how long a idle child  
process will wait for a new request before exit. This option help 
releasing system resources taken by idle processes.


* LSAPI_MAX_IDLE_CHILDREN
    (default value: 1/3 of LSAPI_CHILDREN or LSAPI_CHILDREN)

In Self Managed Mode, LSAI_MAX_IDLE_CHILDREN controls how many idle 
children processes are allowed. Excessive idle children processes
will be killed by the parent process.
When LSAPI_AVOID_FORK is set to 0, the default value is 1/3 of
LSAPI_CHIDLREN, When LSAPI_AVOID_FORK is set to 1, the default value
is LSAPI_CHILDREN.


* LSAPI_MAX_PROCESS_TIME        (default value: 300 seconds)

In Self Managed Mode, LSAPI_MAX_PROCESS_TIME controls the maximum 
processing time allowed when processing a request. If a child process
can not finish processing of a request in the given time period, it 
will be killed by the parent process. This option can help getting rid 
of dead or runaway child process.


* LSAPI_PGRP_MAX_IDLE           (default value: FOREVER )

In Self Managed Mode, LSAPI_PGRP_MAX_IDLE controls how long the parent
process will wait before exiting when there is no child process.
This option help releasing system resources taken by an idle parent 
process.


* LSAPI_PPID_NO_CHECK

By default a LSAPI application check the existence of its parent process
and exits automatically if the parent process died. This is to reduce 
orphan process when web server is restarted. However, it is desireable 
to disable this feature, such as when a LSAPI process was started 
manually from command line. LSAPI_PPID_NO_CHECK should be set when 
you want to disable the checking of existence of parent process.


License
-------

LSAPI library code is under BSD license

LSAPI ruby extension code is under Ruby license

* ((<URL:http://www.ruby-lang.org/ja/LICENSE.txt>)) (Japanese)
* ((<URL:http://www.ruby-lang.org/en/LICENSE.txt>)) (English)


Copyright
---------

Copyright (C) 2006 Lite Speed Technologies Inc.