View Full Version : My first PHP script. :-)
Charles Capps
05-21-1999, 03:31 AM
I work for/with a few people who host a chat on their vserver...[nbsp][nbsp]Don't ask me how they struck a deal with their IPP to get it up, I don't have a clue.[nbsp][nbsp]:)
As an experiment to see if we can get people to complain more/less at the IPP, I whipped up a PHP version of a formerly perl-based chat script...[nbsp][nbsp]You can check it out at: http://www.phoenix50.com/chat/
I'm hoping that this will:
1) Reduce server load somehow, and make the server people either mail us asking if we took the chat down or
2) Find out that PHP is more intense on the server than perl and get kicked off...[nbsp][nbsp]:)
Hey, it's their money.[nbsp][nbsp];)
------------------
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
http://solareclipse.net/
Justin
05-21-1999, 03:58 AM
I'm impressed!! That is friggin kewl :)[nbsp][nbsp]I chatted for a few minutes, and I must say it works pretty good.
Only thing is, I don't think it will affect server load much either way. The problem is that everyone there is refreshing the page every couple of seconds, and that's where the load comes in to play. If it uses a real database as opposed to flat text file, it might be a little better, but it's still being "hit" quite a few times a minute for each user - and who knows how many lurkers are just reading and not posting...
But that is a neat and simple little script :)
Justin
Charles Capps
05-21-1999, 04:04 AM
Ah, but it's not the load on the server in terms of bandwidth I'm worried about - it's the perl...[nbsp][nbsp]Sometimes it could take up to fifteen seconds for a message to submit during peak hours![nbsp][nbsp]Switching to PHP really sped it up...[nbsp][nbsp]
BTW, I JUST missed you, you logged out right when I checked to make sure everyone was behaving.[nbsp][nbsp]:)
And just FYI, there's no database of any type (be it SQL or text) behind it - the HTML page is rewritten when a post is made.[nbsp][nbsp]Really simple.
------------------
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
http://solareclipse.net/
Terra
05-21-1999, 10:16 AM
Interactive CHAT is a servers worst nightmare... ;)
Preliminary thoughts on how to effectively provide this service...
1) Use a combination of Java client tied into an IRC server
2) Access can be done ONLY via the Java client
3) Can only be viewed while connected/realtime
We have a site owner that is using this combination, with the Efnet IRC servers, and one day down the road I will be compiling the Efnet series of Hybrid IRC servers for FQuest usage only...
The scenario given by Charles above is doable, but as Justin points out - the reloads tend to grind the server down...
The final solution is a client/server scenario placing the responsibility on the browser (Java client) and IRC server, leaving the Apaches to serve your web pages instead of bogging them down with multiple keepalive connections...
Apache can only handle 255 concurrent connections at any one time, and I'm running 20-30 domains per Apache pool...[nbsp][nbsp] As you can see - persistant connections can quickly chew up all the slots sending further requests into a backlog queue...
We are contemplating the above design parameters, and testing on this should begin within the next 4 - 6 months...[nbsp][nbsp]It is slated for the 5th generation FQuest servers with the hooks designed in from the beginning to make this a reality...[nbsp][nbsp]This particular model will take a lot of planning/testing to make it work correctly with minimal load to the servers...
--
Terra
--If it's a virtual chat, are you really there?--
FutureQuest
Terra, you said:
1) Use a combination of Java client tied into an IRC server
2) Access can be done ONLY via the Java client
3) Can only be viewed while connected/realtime
The last two are clear.[nbsp][nbsp]But, the first is a mystery to me.[nbsp][nbsp]Where do I go to do this, what should I ask for?[nbsp][nbsp]Any links or recommended irc servers? Does it cost anything? Approximately how much?
I've been inverstigating the remotely hosted chat services, but the banners (literally) make me sick with all the animation.
Terra
05-21-1999, 11:43 AM
The Java client is still up in the air, we may contract someone to write one for us as Java is *not* my language...
For efnet (one of **many** public IRC systems):
www.efnet.org (http://www.efnet.org)
You will also need an IRC client:
www.mirc.com (http://www.mirc.com)
There are a **TON** of administrative overhead/headaches in running an IRC server...[nbsp][nbsp]I chose the IRC server scenario (even though it's a headache) as it is highly scalable, and can tie several servers together as it grows...
This is all very preliminary, mostly thoughts aired out in the open...
As stated above, CHAT is a server's worst nightmare with message boards running a close second...[nbsp][nbsp]This is something that will take time and thought to implement correctly...
--
Terra
--Anyone have any WD-40???--
FutureQuest
[This message has been edited by ccTech (edited 05-21-99)]
Networking is not my specialty, so I have a couple of basic questions.[nbsp][nbsp]Does the 255 concurrent connections per Apache apply to things like telnet, or is this just for http?[nbsp][nbsp]When I'm sitting on my telnet connection for hours doing development work, am I taking up one of those valuable slots?
Further, what are the alternatives to Apache that have much higher connection capabilities?[nbsp][nbsp]I have an unused copy of Solaris 7 lying around for development purposes, but I think you need Sun's web server in addition to the OS, right (just like linux + Apache)?[nbsp][nbsp]Or could you go with an alternative web server that is nearly free and would provide many more connections?
I have been toying with the idea of doing some development work on a multiplayer game server, which would need many more connections, I would think, than 255.
Andrew:[nbsp][nbsp]What java client irc client is your client using.[nbsp][nbsp]Is it IBM's? @ http://www.alphaworks.ibm.com/formula/irc
[This message has been edited by DanS (edited 05-22-99)]
Terra
05-22-1999, 01:14 AM
The 255 concurrent is set as a #define in the Apache source code and can be raised if needed...
I've had to do this on a few occasions for the really large daemons that run on TAZ...[nbsp][nbsp]I've got those running solid at 800 concurrent connections each...
I keep the default (255) on SIX as I'm doing things a bit differently now as I can spread the Apache load over a greater number of IP's...[nbsp][nbsp]If I hit that limit, then I need to take a serious look at the xIP pool and adjust as necessary...[nbsp][nbsp]I use it as a trigger to ferret out the larger domains that need to move to our high-capacity server (NINE)...
Bear in mind, that it also takes a modification to the Linux kernel to go above the 255 limit, which is why Apache is set this way to begin with...
As far as Sun Solaris, it has Linux beat in one major area - it's TCP/IP networking layer is hardcore and in many ways thumps on BSD's implementation...[nbsp][nbsp]But the tradeoff for killer TCP/IP is no match for the applications available for Linux - nor all the open-sourced software...
I will check out that Java Telnet when I get a chance...[nbsp][nbsp]I've seen a few before that look nice and are very functional...
--
Terra
--There's more to living than only surviving--
FutureQuest
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.