Squeak, NT, CGI and Microsofts web server?

Peter William Lount peter at smalltalk.org
Sat Jun 17 00:16:30 UTC 2000


>I recently moved my swikis (one PWS image, one Comanche image) from a
>single PII/400 Linux (SuSE6.0) box to a double PIII/600 (RedHat 6.2). On
>the old one, cpu usage (according to "top") was below 1% when idle (no
>connections). Now, the usage is around 35% for each! Any ideas?
>-- Bert

Hi Bert,

There is a loop in PWS (see code below) that I found consumed a huge amount
of cycles. So I reduced it to waiting for 1ms instead of whatever it
currently is (500). I don't know why the change is needed. Anyway please
confirm if this solves your problem. With this fix on my copy of squeak
running on FreeBSD 3.2 the cpu cycles drop to about 1% or 2% and then to
idle.

There are some other problems that I have with PWS on unix. The X-windows
mouse must be in the main squeak x-window and moving otherwise the PWS
freezes up! Not good. Also when submitting a form it has to be submitted
twice and of course two requests are processed - not good. Any ideas?

All the best,

Peter William Lount
peter at smalltalk.org


PWS class method

loopOnPort: portNumber loggingTo: fileName
	"Loop forever handling HTTP requests. Run backup jobs periodically."

	| secondsBetweenBackups nextBackupTime socket logEntry |
	secondsBetweenBackups _ 1 * (60 * 60).
	nextBackupTime _ Time totalSeconds + secondsBetweenBackups.
	[true] whileTrue: [
		socket _ ServerPort getConnectionOrNil.
		socket notNil ifTrue: [
				logEntry _ self serve: socket.
				ServerLog nextPutAll: logEntry; cr
		] ifFalse: [
			Time totalSeconds > nextBackupTime ifTrue: [  
				"time to back up!"
				logEntry _ self doBackupJobs.
				ServerLog nextPutAll: logEntry; cr.
				nextBackupTime _ Time totalSeconds + secondsBetweenBackups
			] ifFalse: [
				" Original code had a log delay
					(Delay forMilliseconds: 500) wait
				New speed respecting version changes this delay to 1ms.
				If you remove the delay then 100% of CPU cycles will be used - not what
you want."
				(Delay forMilliseconds: 1) wait
			]
		]
	].







More information about the Squeak-dev mailing list