开发者

where to start programing a server application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 9 years ago.

Improve this question

Question: Where is a good starting point for learning to write server applications?


Info:

I'm looking in to writing a distributed computing system to harvest the idle cycles of the couple hundred computers sitting idle around my college's campus. There are systems that come close, but don't quite meet all the requirements I need. (most notable all transactions have to be made through SSH because the network blocks everything else) So I've decided to write my own application. partly to get exactly what I want, but also for experience.

Important features:

  1. Written in python
  2. All transaction made through ssh(this is solved through the simple use of pexpect)
  3. Server needs to be able to take potentially hundreds of hits. I'll optimize later, the point being simulation sessions.

I feel like those aren开发者_开发百科't to ridiculous of things to try and accomplish. But with the last one I'm not certain where to even start. I've actually already accomplished the first 2 and written a program that will log into my server, and then print ls -l to a file locally. so that isn't hard. but how do i attach several clients asking the server for simulation data to crunch all at the same time? obviously it feels like threading comes in to play here, but more than that I'm sure.

This is where my problem is. Where does one even start researching how to write server applications? Am I even using the right wording? What information is there freely available on the internet and/or what books are there on such? again, specifically python, but a step in the right direction is one more than where i am now.

p.s. this seeemed more fitting for stackoverflow than serverfault. Correct me if I am wrong.


Check out the following discussion on SO

  • Would twisted be a good choice for building a multi-threaded server?

Also check out the fantastic introductions at

  • Twisted Introduction : http://krondo.com/?page_id=1327
  • Twisted Web in 60 seconds : http://jcalderone.livejournal.com/50562.html


Twisted is an event loop framework that is commonly used in Python for network handling.


Here's an approach.

  1. Write an "agent" in Python. The agent is installed on the various computers. It does whatever processing your need locally. It uses urllib2 to make RESTful HTTP requests of the server. It either posts data or requests work to do or whatever is supposed to go on.

  2. Write a "server" in Python. The server is installed on one computer. This is written using wsgiref and is a simple WSGI-based server that serves requests from the various agents scattered around campus.

While this requires agent installation, it's very, very simple. It can be made very, very secure (use HTTP Digest Authentication). And the agent's privileges define the level of vulnerability. If the agent is running in an account with relatively few privileges, it's quite safe. The agent shouldn't run as root and the agent's account should not be allowed to su or sudo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜