Any way to reduce load on server [closed] - profiling

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am about to make an online game that will be played by about 1500 people at the same time. It will be a simple AJAX based quiz for a college competition. But the last time I made such a quiz, due to heavy traffic, the server kept crashing. We had to restart the server several times during the game. Still, access to the site was very slow. I have seen other college websites and their games don't seem to have such problems. Can anyone tell what might be our mistake? Since I am a student at college (not even of computer science), I am not very much aware of server administration.

Simply put, you are overloading your server with hits so you may want to look at the server stats to see where the bottleneck was/is. Only then can you decide if going with a larger server is more beneficial, or splitting out the application into another tier ...web and application.
this will spread load more evenly and reduce your bottlenecks.

Called smart programming.
Get a profiler.
Find out where the time in your code is spent.
Fix it.
That is all you can do. THis is not server administration, thisis bad programming bogging down the server, and you ahve to make an analysis and fix it. 1500 people on a quiz is something a mobile phone should be able to handle, so whatever server you ahve is big enough.

Related

AdHoc network Library Linux [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I need to set up an AdHoc network in linux (Debain specifically) in a C/C++ program. It needs to be able to search for existing networks, or at least confirm that a network exists with a given SSID, connect to it, and be able to determine the number of jumps it takes to get to any given node.
I do have enough programming experience to write my own, but it would be a whole lot of work and this seems like a common enough task that there's bound to be one in existence already. I suppose it doesn't have to be c/c++ (I could run the program externally or create some sort of wrapper), but it would be very nice if it were all "one" language.
Thanks in advance!
You could download an open source program that does the scanning + connection, like
iwScanner
or wicd is probably more appropriate
and modify it to fit your needs,
or connect via existing command line tools, in a script
Sample steps in this page
Regarding counting the number of hops, you can use the traceroute utility, in a script,
traceroute man page

Multithreaded Webserver in C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to do a multithreaded Webserver with scheduling and synchronization in C++.This is an assignment problem and I am not asking the code.I have done till the socket connection in server but I dont know how to proceed.I just want some hints or flow for the program.
Here are the few questions I have
1) I have done till socket accept().So when new connection comes I have to fork() and then close the connections of the child process.Is that right?
2) How must I make sure the program is synchronized wth so many threads running?
3) I must have 2 thread pools.1 pool of workers and in the other 2,1 each for acepting connection and inserting the request to ready queue.How can this be done?
I am not asking the code.I just need some hints and guidance.Thanks a lot.
Very interesting course work , if you get you head around this one a lot of concepts will become clear namely concurrency and one of its major use cases I.e. networking!
I used the following article myself to get a quick summary of my options in network concurrency in Linux
http://m.linuxjournal.com/content/three-ways-web-server-concurrency?page=0,0
This article give very high level intros to concepts tha thou will need like copy on write for forked processes and as a result separate address spaces negating sync in certain cases, once you have read this you will have more specific question that you can as once you start getting your hands dirty starting with the code in this article.

How does one make something real time? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
This might be a really stupid question, but I can't find any info on this, and I can't find out what to search for.
How do you make something real time? For example, say we have a game, how does it run continuously without us calling a tick() method at different parts of the program?
If you are developing the program to run at a time in particular the best way I know of is to develop it to run at a particular loop rate using timed delays.
IE:
while(forever) {
do something
test how long it took
take up the remainder amount of time for the loop to run at a rate (ie 100Hz)
}
If you are desperate for real time applications you can develop and use QNX:
http://www.qnx.com/
But this certainly wouldn't be a good environment for programming games.

OS development. How to start? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am java developer. I always wanted to write my own kernel and develop an small os, I don't know what this kernel or os will look like or what they will do but I have a passion develop something useful to contribute to this vast and beautiful open source world. I want to do this but my problem is that I don't know how to start. I had studied c/c++ in my college days, now I don't remember much of these programming languages but I can brush that up to get started. I know this journey would be difficult and long but each long journey starts with a single step.
To make sure I take correct step in right direction I need help of experts on this forum to guide me to correct direction. I am not expecting spoon feeding but your thoughts on this and references to the good books and links that could help a newbie like me to get started with such programming.
Thanks
To be honest:
I don't know what this kernel or os will look like or what they will do but I have a passion develop something useful to contribute to this vast and beautiful open source world.
If your aim is to contribute to the Open Source software pool, do not attempt to write an operating system, but pick a different thing to do. There are literally hundreds of OS projects, some of them several years in the making, and the general consensus of the OS development community over at OSDev.org is that it is interesting and fun, but not necessarily productive.
If you insist, follow that link I gave; you will find information and further links there.
Edit: If you are looking for an interesting project to learn a new language with, pick something that you would want to use. There's a reason why so many people have programmed a calculator or an address management in their early days. But seriously, C++ in kernel space is so very much different from C++ in application development that they could just as well be different languages.

get instant energy consumption [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I am looking to get instant energy consumption, in shell or C++
any ideas ?
Thanks
Your question could do with a bit more detail, but if I understand you correctly a program named Joulemeter does this the following way:
Joulemeter estimates the energy usage
of a VM, computer, or software by
measuring the hardware resources (CPU,
disk, memory, screen etc) being used
and converting the resource usage to
actual power usage based on
automatically learned realistic power
models.
That is one way to go. If you're just doing this for your own project, I guess you could throw together some hardware that measured from the wall socket and gave you the data that way. Maybe something like that exists already.
Well, if you have a Laptop you could use the answer presented for this similar question:
/usr/sbin/system_profiler SPPowerDataType | grep Wattage