Jaslabs: High performance Software

High Performance Software

Archive for the 'iis' Category

Tuning IIS for PHP

IIS is a multi-threaded web server available on Windows NT and 2000. From the Internet Services Manager, it is possible to tune the following parameters:

Performance Tuning based on the number of hits per day: Determines how much memory to preallocate for IIS. (Performance Tab).

Bandwidth throttling: Controls the bandwidth per second allocated per web site. (Performance Tab).

Process throttling: Controls the CPU% available per Web site. (Performance Tab).

Timeout: Default is 900 seconds. Set to a lower value on a Local Area Network. (Web Site Tab).

HTTP Compression: In IIS 6, you can compress dynamic pages, html and images. Can be configured to cache compressed static html and images. By default compression is off.

HTTP compression has to be enabled for the entire physical server. To turn it on open the IIS console, right-click on the server (not any of the subsites, but the server in the left-hand pane), and get Properties. Click on the Service tab, and select “Compress application files” to compress dynamic content, and “Compress static files” to compress static content.

You can also configure the default isolation level of your web site. In the Home Directory tab under Application Protection, you can define your level of isolation. A highly isolated web site will run slower because it is running as a separate process from IIS, while running web site in the IIS process is the fastest but will bring down the server if there are serious bugs in the web site code. Currently I recommend running PHP web sites using CGI, or using ISAPI with Application Protection set to high.

You can also use regedit.exe to modify following IIS 5 registry settings stored at the following location:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters
MemCacheSize: Sets the amount of memory that IIS will use for its file cache. By default IIS will use 50% of available memory. Increase if IIS is the only application on the server. Value is in megabytes.

MaxCachedFileSize: Determines the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).

ObjectCacheTTL: Sets the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).

MaxPoolThreads: Sets the number of pool threads to create per processor. Determines how many CGI applications can run concurrently. Default is 4. Increase this value if you are using PHP in CGI mode.

ListenBackLog: Specifies the maximum number of active Keep Alive connections that IIS maintains in the connection queue. Default is 15, and should be increased to the number of concurrent connections you want to support. Maximum is 250.

If the settings are missing from this registry location, the defaults are being used.

High Performance on Windows: IIS and FastCGI

After much testing, I find that the best PHP performance on Windows is offered by using IIS with FastCGI. CGI is a protocol for calling external programs from a web server. It is not very fast because CGI programs are terminated after every page request. FastCGI modifies this protocol for high performance, by making the CGI program persist after a page request, and reusing the same CGI program when a new page request comes in.

As the installation of FastCGI with IIS is complicated, you should use the EasyWindows PHP Installer. This will install PHP, FastCGI and Turck MMCache for the best performance possible. This installer can also install PHP for Apache 1.3/2.0.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
2 comments

Using the iis 6 ftp service


By Justin Silverton

Install Internet Information Services and the FTP Service

Because FTP depends on Microsoft Internet Information Services (IIS), IIS and the FTP Service must be installed on the computer. To install IIS and the FTP Service, follow these steps.

NOTE: In Windows Server 2003, the FTP Service is not installed by default when you install IIS. If you already installed IIS on the computer, you must use the Add or Remove Programs tool in Control Panel to install the FTP Service.

1. Click Start, point to Control Panel, and then click Add or Remove Programs.
2. Click Add/Remove Windows Components.
3. In the Components list, click Application Server, click Internet Information Services (IIS) (but do not select or clear the check box), and then click Details.
4. Click to select the following check boxes (if they are not already selected):
Common Files
File Transfer Protocol (FTP) Service
Internet Information Services Manager
5. Click to select the check boxes next to any other IIS-related service or subcomponent that you want to install, and then click OK.
6. Click Next.
7. When you are prompted, insert the Windows Server 2003 CD-ROM into the computer’s CD-ROM or DVD-ROM drive or provide a path to the location of the files, and then click OK.
8. Click Finish.
IIS and the FTP service are now installed. You must configure the FTP Service before you can use it.

Configure The FTP Service

To configure the FTP Service to allow only anonymous connections, follow these steps: 1. Start Internet Information Services Manager or open the IIS snap-in.
2. Expand Server_name, where Server_name is the name of the server.
3. Expand FTP Sites
4. Right-click Default FTP Site, and then click Properties.
5. Click the Security Accounts tab.
6. Click to select the Allow Anonymous Connections check box (if it is not already selected), and then click to select the Allow only anonymous connections check box.

When you click to select the Allow only anonymous connections check box, you configure the FTP Service to allow only anonymous connections. Users cannot log on by using user names and passwords.
7. Click the Home Directory tab.
8. Click to select the Read and Log visits check boxes (if they are not already selected), and then click to clear the Write check box (if it is not already cleared).
9. Click OK.
10. Quit Internet Information Services Manager or close the IIS snap-in.
The FTP server is now configured to accept incoming FTP requests. Copy or move the files that you want to make available to the FTP publishing folder for access. The default folder is drive:\Inetpub\Ftproot, where drive is the drive on which IIS is installed.

adding a virtual directory

This is probably one of the most confusing issues with the IIS ftp service. To create a virtual directory, do the following:

1) right click your new ftp server that you created from above (in iis manager) and go to new->virtual directory.
2) it will ask you for the alias (how people will access this directory and the location (which is the actual physical directory on your harddrive).
3) after this is created, you may try to login to your ftp server and see if your directories are listed. They won’t be there.
4) Most FTP server use the actual file structure of your system to determine what directories to display to the user.

To allow your virtual directories to be seen, go into the home directory of your ftp site and create an empty directory with same name as your virtual one (the alias).

This works virtual directories take precidence over file-system directories.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
No comments

php 5.0 and iis - authentication issues

by Justin Silverton

I installed php 5.0/iis 6 (the isapi dll manually) today on one of my new development servers, following the directions from the install.txt (and using the steps that I wrote about in a previous article). After I created a test php file and attempted to launch it from a web-browser, I was shown a username and password box.

if you are getting the message box above, it is most likely a permission problem.

The following can be done to fix it:

1) make sure the path has c:\php (where your php is installed)
-this can be done by going to start->settings->control panel->system, then clicking on the advanced tab, and finally clicking on “environment variables”. The path variable is located within the second box on the page.

2) the following files need to have their permissions set to read by the user account IIS uses to launch files (typically IUSR_(your server name):

php.ini
php5ts.dll

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
No comments

How to install php 4.4.1 on iis 6.0 - updated

Earlier this month, I wrote a howto on how to install php 4.4.1 on iis 6.0. I have a small change in those instructions.

As I have recently discovered (I’m not sure why I never saw this before), if you set the doc_root=your web directory, IIS will not be able to see a php file in any of your subdirectories.

This value doesn’t even need to be set at all.

so, rather than setting the doc_root to your web root directory, don’t even bother settting it, unless you know what you are doing.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
No comments

How to install php 4.4.1 on iis 6.0

Although this is not as common as installing it on a *nx machine (since I personally use freebsd and linux, im not going to play favorites), there are still a great deal of people out there that for one reason or another, would like to php scripts on a windows 2003 box (the company I worked for would not allow us to run anything but windows machines).

Steps for installing php 4.4.1 on a windows 2003 machine

note: These instructions are for iis 6.0

Step 1: Download php 4.4.1 (get the binary package, not the installer)
Step 2: Extract the .zip file you just downloaded (I usually extract it to the c drive and rename it php, but the name can be anything).
Step 3: Launch the iis (internet information services) manager
Step 4: Click on “web service Extensions” on the left and right-click on the right and pane and go to “add a new web service extension”. There should now be a new window on the screen. for “extention name” use “.php”. Click the add button on the right, and point it to c:\(the php directory from step 2)\sapi\php4isapi.dll. After this is done, check the box that says “set extension status to allowed” and click ok.
Step 5:

a) right-click “web sites” and go to properties.
b) click on the tab “home directory”
c) where it says “execute persmissions” it should state: “scripts and executables”
d) click the “configuration…” button
e) click the “add…” button
f) for executable, use the same one from step 4 (php4isapi.dll).
The extensions should be .php.

Step 6: copy php.ini to c:\windows and php4ts.dll,php4ts.lib to c:\windows\system32

Testing your new installation:

I usually create a file called “info.php” with the following:

If everything has been installed properly, when you go to “info.php”, you should see an information page about php 4.4.1

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
3 comments

Next Page »