Project

General

Profile

« Previous | Next » 

Revision 6e337a84

Added by Scott Ullrich about 17 years ago

Tune PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS depending on how much
ram is installed for the captive portal operations.

Idea semi taken from http://forum.pfsense.org/index.php/topic,8861.new.html#new

NOTE: The forumula could probably be revised a bit but this is a good start.

View differences:

etc/inc/system.inc
745 745

  
746 746
	if($avail > 127 and $avail < 256) {
747 747
		$max_procs = 2;
748
		$max_requests = 1;
748
		$max_requests = 5;
749 749
	}
750 750

  
751 751
	if($avail > 255 and $avail < 384) {
752 752
		$max_procs = 3;
753
		$max_requests = 1;
753
		$max_requests = 10;
754 754
	}
755 755

  
756 756
	if($avail > 383 and $avail < 512) {
757 757
		$max_procs = 4;
758
		$max_requests = 1;
758
		$max_requests = 16;
759 759
	}
760 760

  
761
	if($captive_portal == true)  {	
762
		$bin_environment =  <<<EOC
763
        "bin-environment" => (
764
           "PHP_FCGI_CHILDREN" => "16",
765
           "PHP_FCGI_MAX_REQUESTS" => "{$max_requests}"
766
        ), 
767
EOC;
768

  
769
	} else {
770
		$bin_environment = "";
771
	}
772
		
761 773
	if($fast_cgi_enable == true) {
762 774
		$module = "\"mod_fastcgi\", \"mod_cgi\"";
763 775
		$cgi_config = "";
......
770 782
			"socket" => "/tmp/php-fastcgi.socket",
771 783
			"min-procs" => 1,
772 784
			"max-procs" => {$max_procs},
785
			{$bin_environment}			
773 786
			"bin-path" => "/usr/local/bin/php"
774 787
		)
775 788
	)

Also available in: Unified diff