Php running slowly on a windows server

  • Munchkin1
  • Born
  • Born
  • Munchkin1
  • Posts: 3

Post 3+ Months Ago

I have been “volunteered” for updating a school website. I am trying to reduce the amount of updating work I have to do by allowing the school staff (and children) to update the content themselves. In the past I have written a php script to authenticate a username and password and allow a user update their content by typing it into a textarea on a web page. It is saved in a text file and displayed on the users page with a php include. This has worked well on a Linux server (with php 5). The school site is hosted on a windows server (with php 4) and is giving problems. It works but is slow and keeps timing out.
If I rewrote the whole thing in asp would it run faster?
Or has anyone got any other suggestions ?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Chaze
  • Graduate
  • Graduate
  • User avatar
  • Posts: 111
  • Loc: WebHost.pro

Post 3+ Months Ago

I think the question answered itself. Windows is a resource hog within itself so you are already slow.

I would do a cron job to optimize your DB nightly or even better check out a Linux server!
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6251
  • Loc: Seattle, WA

Post 3+ Months Ago

dwhswebhosting wrote:
Windows is a resource hog within itself so you are already slow.

Want to elaborate on that a bit?
  • Chaze
  • Graduate
  • Graduate
  • User avatar
  • Posts: 111
  • Loc: WebHost.pro

Post 3+ Months Ago

spork wrote:
dwhswebhosting wrote:
Windows is a resource hog within itself so you are already slow.

Want to elaborate on that a bit?


Sure, windows requires more CPU resource to run basic services so there is less CPU resource available for the scripts that need it when running a little rich. It just takes more process to do even the most basic tasks. Now when running near perfect it's fine, but if things start get a little sticky then it snowballs quick into a small system.

Either get everything back to near perfect or you will have more issues.

Also it could be the hardware namely the hard drive or ram running slow.

I would consider trying new memory first.
  • Munchkin1
  • Born
  • Born
  • Munchkin1
  • Posts: 3

Post 3+ Months Ago

dwhswebhosting wrote:
I think the question answered itself. Windows is a resource hog within itself so you are already slow.

I would do a cron job to optimize your DB nightly or even better check out a Linux server!

I am stuck with a Windows server. It’s a School site and all the education authority’s sites are hosted on the same windows server.

I was just hoping to avoid rewriting things using asp when I already have them in php. Anyway I have done it now and can a say asp does run faster than php on windows (though not as fast though as php on Linux)

Permissions are also a pain on windows. I found that users do no have permission to create files (so cannot provide users with an file upload page) in fact I could only write to a single folder

Still it is done now. My conclusion, if you can stick to Linux
  • Chaze
  • Graduate
  • Graduate
  • User avatar
  • Posts: 111
  • Loc: WebHost.pro

Post 3+ Months Ago

I agree, asp is better for windows. Hopefully you will get some feedback here from someone that has to use windows for the DB as well.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

First thing I'd look into.
http://xcache.lighttpd.net/wiki/Introduction

--

Next thing I would look for is whether there are any high traffic pages that look exactly the same for everyone, and setup a static HTML cache for those pages.

The editors would automatically purge relevant cache files any time an edit is made allowing the page to be regenerated next time it's requested.

There is typically a noticeable difference between the time it takes for a server to return a static HTML file and the time it takes to regenerate that file every time before returning it.
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

Hardware- So, the server needs a hardware upgrade?
This is a topic that I've been dealing with for a bit this year. Obviously, your school has sub-hardware to be running windows. Apache is a quite a memory hog so the server really needs to be sportin' some nice hardware to run smoothly. My best guess is the server hardware for the WAMP. Time for the school to upgrade the server...probably not going to happen.

Configuration- Can't get a server upgrade, maybe there's a configuration??
I had a script that I knew worked on another WAMP I had setup but it had tons of power. I tried the same script on a WAMP I setup on just an ordinary office computer and it timed out over and over again. I was pretty sure it was due to the lack of hardware so I thought I could find 'that config setting' that would straighten it all out. I was wrong. I tried everything to try to allocate more memory to my server programs and my php script. No code or config worked.

Best solution which I love now and Joebert has it right is Lighttpd. Don't worry about the xcache, just uninstall any other server stuff and install and use Lighttpd. I finally found the installer for windows so it takes a little searching and also I could only get the Hungarian language for the install wizard on the download page for some reason but I just kept hitting what I thought to be next and I was right. It installed in seconds, already configured, and ran at less than half the resources as apache. I tried the original script again and presto, No time out.

Hope this helps for the future even though you've already done the asp stuff. lighttpd.net

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.