Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I got application server running in Windows – IIS6.0 with Zend Server to execute PHP. I am looking for lightweight static content only web server on this same machine which will relive IIS form handling static content and increase performance.
It need to be only static content web server – maximum small and maximum effective – lighttpd seems too big because allow to FastCGI.
I am looking for: Windows, static content only, fast, and lightweight.
I am using Windows Server 2003.
You can use Python as a quick way to host static content. On Windows, there are many options for running Python, I've personally used CygWin and ActivePython.
To use Python as a simple HTTP server just change your working directory to the folder with your static content and type python -m SimpleHTTPServer 8000, everything in the directory will be available at http:/localhost:8000/
Python 3
To do this with Python, 3.4.1 (and probably other versions of Python 3), use the http.server module:
python -m http.server <PORT>
# or possibly:
python3 -m http.server <PORT>
# example:
python -m http.server 8080
On Windows:
py -m http.server <PORT>
Have a look at mongoose:
single executable
very small memory footprint
allows multiple worker threads
easy to install as service
configurable with a configuration
file if required
The smallest one I know is lighttpd.
Security, speed, compliance, and flexibility -- all of these describe lighttpd (pron. lighty) which is rapidly redefining efficiency of a webserver; as it is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting and many more) lighttpd is the perfect solution for every server that is suffering load problems. And best of all it's Open Source licensed under the revised BSD license.
Main site: http://www.lighttpd.net/
Edit: removed Windows version link, now a spam/malware plugin site.
Consider thttpd. It can run under windows.
Quoting wikipedia:
"it is uniquely suited to service high
volume requests for static data"
A version of thttpd-2.25b compiled under cygwin with cygwin dll's is available. It is single threaded and particularly good for servicing images.
Have a look at Cassini. This is basically what Visual Studio uses for its built-in debug web server. I've used it with Umbraco and it seems quite good.
I played a bit with Rupy. It's a pretty neat, open source (GPL) Java application and weighs less than 60KB. Give it a try!
You can try running a simple web server based on Twisted
nginx or G-WAN
http://nbonvin.wordpress.com/2011/03/24/serving-small-static-files-which-server-to-use/
Related
I have exhausted my ability to find answers on the web for this one. I'm trying to install mod_perl on windows and there are many dead ends.
Is mod_perl even what I'm looking for?***
I have a collection of web apps used within my company's local network for database and file system interface. The web server runs Apache 2.2 and ActivePerl 5.16 using DBI, DBD::mysql, and CGI. The clients get their dynamic content via AJAX calls (jQuery.getJSON) to the Perl scripts using CGI parameters. The traffic is extremely light - only 4 or so users and only a few queries at a time here and there.
The issue I'm having is that the latency is unacceptable for the nature of these apps. The delay is typically around 400ms, all waiting time. I have experimented with increasingly simplistic Perl scripts and believe all of the delay is the Perl interpreter. I've looked into FastCGI but as I understand this deals mostly with high traffic which is not my problem: it's the overhead of each low-traffic call. So it seems like an Apache-embedded Perl interpreter (as I understand mod_perl to be) would solve my overhead-related latency issues.
How do you install it in a post Randy Kobes world?
All resources I've found for installing mod_perl for my setup involve a server theory5x.uwinnipeg.ca formerly run by him and now defunct after his passing. ActivePerl ppm does not have any mod_perl built in packages and the website shows all build failed listings.
Here is an ActiveState community post explaining why there is no ppm.
I did find this resource that seems to have all the missing pieces but for Strawberry Perl.
So I'm left to think the only way to do this is to install from source, but I have no understanding of how to do this. I have zero familiarity with Linux and it seems like most of this stuff is geared toward it. Worse yet I have a 64-bit Windows XP and a Windows Server to install it on.
The other thing that crossed my mind is maybe I need to install some kind of distribution like XAMPP instead of putting together all the pieces myself. I'd be quite nervous to change course now and risk breaking my working but slow apps
Is mod_perl even what I'm looking for?
I hope not.
There are issues with mod_perl. Your Apache, mod_perl and perl need to all be built with compatible compilers and architectures so they can all be linked at run time. There will be no running of a 32bit Apache with a 64bit perl when you are using mod_perl. In my experience mod_perl should also be compiled against header files for your specific versions of both Apache and perl. Presuming you get all this secret sauce mixed up correctly, you are now running a web server that can be crashed by a poorly written perl script. But on the bright side, this is more efficient than common CGI.
After a few years of this madness, FastCGI was invented. By running as a persistent, but separate, process, the web server was able to achieve mod_perl (or mod_PHP, or mod_python) efficiency without the need for binary compatibility or the stability risks. Just think of the freedom! An Apache module that cares only about binary compatability with it's Apache host and can farm out tasks to Perl, Python, C or even Visual Basic. ( I just had an evil thought about trying to do web services with Forth or Lisp, but that would just be crazy.)
Running on a linux distro (or other canned XAMPP stack) can make setup and maintenance of mod_perl easier because they will distribute it in a package that has been compiled to work with the packages they supply of both Apache & perl. Unfortunately if you want to run with a version of Apache or perl that is not "official" to your distro, get ready to DIY. Even so, a distro's packages do not mitigate the stability issues inherent in running mod_(language-of-choice).
In any case, before you're up and running in your new configuration, your existing CGI scripts will need to be modified. You can choose to rewrite them to mod_perl, FastCGI, or PSGI/Plack standards. If you choose to rewrite to PSGI/Plack standards, then you can care much less about the specifics of your web server's current or future configuration.
How do you install it in a post Randy Kobes world?
The last link in your question appears to be spot on. Do you have a religious or PHB based reason to prefer ActivePerl over StrawberryPerl? In the end, mod_perl requires that it be built against your specific version of Apache and your specific version of perl. This will either involve compiling it yourself, somebody else wrapping up versions for multiple Apache/perl version combos, or somebody else wrapping up a single version and asking you to use their preferred versions of Apache & perl.
If you choose the mod_perl route and believe even slightly that server software should be kept up to date (XP? Seriously?), then be prepared to either roll your own or trust your 3rd party to keep you up to date. Of course, if you're a hit-and-run developer, well that frees up your choices considerably...
tl-dr:
FastCGI is your friend. Particularly if you are running Windows and like to keep server software up to date.
mod_perl works best when supported by a responsible distro or a responsible developer who is comfortable building it from it's source. ...repeatedly.
It's been an eternity since I've installed mod_perl on Windows so I'm not sure I can help you with that.
But your understanding that FastCGI "deals mostly with high traffic" is not correct. Both FastCGI and mod_perl will offer very similar performance benefits, because both will execute your scripts with a persistent interpreter–eliminating the overhead of starting up perl and compiling your code on each request. Therefore, there is no reason not to give FastCGI a shot.
You might want to look at the PSGI/Plack API which allows you to write code agnostically that can run under vanilla CGI, FastCGI, mod_perl, or with a PSGI-aware server such as Starman, or uwsgi. All of these except for vanilla CGI offer a persistent environment that will reduce the overhead of executing your scripts.
I'm currently developing a web-app, and I alternate between Windows and Mac dev machines for this.
My problem is that pages render extremely slowly on Windows, but it's not my Ruby code running slowly, but rather that static files are getting served slowly.
A typical page takes about 200ms to render and get served in dev (both Mac and Windows are similar here), but it includes about 50 static files (in production it's just 5 to 10, once they get minified and combined, but in dev they're still separate).
Those 50 files take about 1.5 seconds to serve on the Mac, but about 10 seconds on Windows. Which makes it quite tortuous to test things...
I've tried both Webrick and Thin, they are about the same.
Has anybody found this problem and know how to improve this?
I've tried changing the Webrick conf to ":DoNotReverseLookup => true", as suggested in this answer, but it's not helping.
Any help will be greatly appreciated
Thanks!
Daniel
You are running into two existential problems that have plagued Ruby developers for a long time:
Webrick is slow. Always. Just don't even bother.
Ruby is always slower on Windows. Sometimes by orders of magnitude as you've found.
So if you insist on doing development on Windows proper (as opposed to developing only on Linux or developing on a Linux VM running on Windows), then we need to figure out some ways of putting lipstick on a pig.
Some ideas:
Make sure you run the latest version of Ruby.
Try deploying nginx with Thin as shown in this helpful albeit dated tutorial. This will help you get the most out of Thin's multithreading and asynchronicity.
Use Capistrano to deploy to Windows via this also dated GitHub project.
If you do decide you've had enough of developing Rails on an environment it wasn't designed for, you can set up a VM in the manner described here. The author reports significant speedup.
Use an Ubuntu VM inside VirtualBox, it's probably much closer to your deployment environment then mac and windows which means less "but it worked in development" troubles in production.
Also, you will save yourself a lot of time dealing with quirks of different ruby/gems implementations and various levels of headache due to native extensions.
You can:
set up internal network so you can use browser under windows to browse the app running inside the VM
use something like putty to open console sessions to VM
share a Dropbox/Sparkleshare folder with your Ubuntu VM so you always have same code between Windows and Mac box and Ubuntu VM
and this enables you to use your favorite editor under windows/macos to edit files inside the VM
you can use that same VM under Mac too
Ubuntu installation under VirtualBox is fast, easy and well documented, it's pretty much just a wizard. Alternatively, you can try finding a good vagrant recipee (see http://www.vagrantup.com/) or ask around to see if a colleague of yours would be willing to share his/her vbox.
I experienced a performance decrease on development (due to real-time compilation) working with projects with a large number of assets, but I was not on Windows.
I assume the large performance difference may be caused by some inefficient asset compilation under Windows.
I don't any Windows development experience, I haven't been using a Windows machine for a long time, however I registered a noticeable performance increase in parallel asset processing (in development) when I switched to multi-thread servers, specifically Puma. Keep in mind that, in any case, the default Rails webserver (Webrick) is very inefficient.
As Konstantine explained in this answer, there are currently several choices available. You can group them by the processing mode.
Skipping all the background history about Ruby threads, multi-process etc, I'd invite you to try Puma in your machine and see if it improves the load.
Puma works better with Ruby implementations that offer real multi threading, but quoting the official readme
On MRI, there is a Global Interpreter Lock (GIL) that ensures only one thread can be run at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries).
Puma is designed to provide a simple and high performance request/response pipeline to Rack apps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Are there any tools for windows like that *nix world has? I am looking for something like Chef or Puppet.
I have found cfEngine but it still looks very *nix centric. Ideally it would be open source, and command line driven.
The idea is to put together an automated infrastructure with windows based servers. Our current IT department does not allow non-windows servers.
Chef is supported on Windows by Opscode. While we don't run Windows for any of our infrastructure, we do have developers who are continually improving our Windows support. We also get community contributions, and most of the early phase Windows functionality for Chef was contributed by the community.
Important: Opscode now provides an MSI installer for Chef on Windows. This makes it easier than ever to get Chef and Ruby installed on Windows.
While we have a lot of Unix/Linux background across our teams, our intention is that Windows is treated as a first class citizen. 2012 will be a big year for Chef and Windows. Keep an eye on the Opscode blog for announcements.
The following Chef Resources work on Windows:
Environment Resource: sets windows environment variables
User
Group
Mount
File
Gem Package
Remote File
Cookbook File
Template
Service
Ruby Block
Execute
That is, these are resources included in Chef itself. As Chef is extensible with cookbooks, many more resources are added through a variety of Windows specific cookbooks. Read on for more information.
You can get started with using Chef and Windows here:
http://wiki.opscode.com/display/chef/Fast+Start+Guide+for+Windows
Originally, Doug MacEchern wrote some cookbooks to do a number of things to automate windows, too.
https://github.com/dougm/site-cookbooks/tree/master/windows
This information and more available on the Chef Wiki:
http://wiki.opscode.com/display/chef/Installation+on+Windows
Update
The following cookbook adds new resources to Chef to manage Windows:
http://community.opscode.com/cookbooks/windows
It is an update/rewrite of Doug's fine resources from his repository linked above. Documentation is available on the Chef Wiki.
The following cookbook deploys PowerShell and provides a resource to run PowerShell commands/scripts directly in Chef Recipes:
http://community.opscode.com/cookbooks/powershell
Documentation is available in the README.md included in the cookbook tarball.
Additional cookbooks for installing 7-zip, managing IIS and SQL Server have been added. Our "database" cookbook has been extended with a resource/provider for managing SQL Server databases and users (with the tds rubygem).
The knife-windows plugin for knife adds functionality for interacting with Windows systems to provision them with Chef installation.
Update: We have now added File ACL support for Windows to Chef, for all the usual file/directory suspects.
Cfengine Nova has had stable native support for Windows for years (i.e. no Cygwin is needed).
Everything that is possible on Unix (e.g. run commands, file copy, file edit, etc.) can also be done on Windows, with addition to Windows-specific features like
Registry management
File ACL permissions
Windows service management
Event log support
Advanced OS discovery (version, arch, service pack, network, domain, etc.)
For a short introduction, look in Section 11 of the Nova supplement manual: http://cfengine.com/files/Nova_Supplement.pdf
I have been looking for exactly the same thing.
I ran across Windows PowerShell Desired State Configuration which purports to do many of the CM tasks you'd want to do with Chef/Puppet.
I am not going to give any opinion on it because I am still early in evaluating it - but if you're still looking for something, give this a shot.
Having had a deal of experience here i think that it really depends what you need to manage on a given box. Find your most common use case and ask a more specific question in terms of: whats the best tool for managing that. Things like IIS can be tricky (on older windows builds at least) and finding modules for CM tools to manage things like IIS settings and app pools can be hit and miss - especially when it comes to advanced settings (worker thready recycling springs to mind)
However Puppet has forge modules for more basic IIS settings which largely worked for me - and i really like the declarative format here - especially if you are managing large numbers of IIS servers
Also one of the major issues with Windows and configuration management is the lack of a proper package management solution - what actually comes in really handy here is something called Chocolatey (see http://chocolatey.org/) there is a plugin to use this as a provider in puppet - making the whole management process particularly easy. However i imagine that this can be integrated with other CM tools aswell - but does a great deal to help with installing software automatically in a windows environment
Though it is worth stating that whatever you end up using you will have to spend a while figuring out some odd bugs - windows and scripting/automation is not the best.
Based on my experience, I am glad to use such toolset:
Use powershell to manage the windows configuration. If only windows server, you can remotely execute the ps script.
If you like, suggest to use Puppet or Chef to distribute your powershell script into client.
If you like, suggest to use cygwin + (windows sshd) + crond to manage the shell-likely scripts which run in windows.
I think its better if you can use Microsoft System Center.
It a solution from the Microsoft to manage Microsoft base products form desktops to servers and all. Should give a try ...
How to Deploy Applications in Configuration Manager
Deploying Software and Operating Systems in System Center 2012
I don't recommend Chef unless you are a software developer who knows ruby. Chef is designed for software developers who want to manage IT infrastructure. Not for SysOps people who are the ones that actually end up managing it. It tries to treat IT infrastructure like code which is counter intuitive to how it actually works which is more like just data.
Puppet is more friendly for SysOps people imho but still can be complicated.
The good news is that there are other options as well. Less so for windows but projects like Puppet do support it reasonably well.
Apologies if the question appears ambiguous, I have little experience in this area and was after some informed opinions.
I am deploying a test scenario of a server/client network and need to make some choices for Server.
The client will be a Windows system as it meets the requirements for the client, the server choice has more room for selection.
From my experience with Linux in general and the appealing nature of open source for low cost, security etc and the availability and performance of database and web server programs I have been considering CentOS as a server choice.
How well does this operate with Windows clients?
Am I being too selective and creating unnecessary complication by setting out not to use a Windows Server OS?
Well, yes, very ambiguous!
Essentially, your client / server network will be dependent on one thing - clients are Windows, do you want to authenticate using Active Directory? Yes? Then you'll need Windows servers too.
It really depends on what your test scenario is aimed at testing and without significantly more detailed information as to what your end goal is, we'll be at a loss to help you.
This question would actually be better placed on the Server Fault site, unless your ultimate goal is an environment in which to test application development.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users.
So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old IIS be сonvenient enough?
I understand you will serve only static files. In this case, lightweight HTTP servers will give you a higher performance for a given machine. The following are well known:
Lighttpd
Thttpd
Nginx
Many more are listed on Wikipedia. There's a more recent article on IBM DeveloperWorks.
It all depends on your skill level and how much load you are getting on your servers.
If you have spare (physical) resources and have the technical skills and experience to maintain production machines running different operating systems, I'd recommend going running lighttpd on either Linux or FreeBSD. A light OS install with a static file optimized server will perform faster than Apache or IIS on a heavy OS.
However, unless you are extremely comfortable with these solutions, just stick to IIS on Windows. Move the static files to their own machine if you have sufficient load. If you aren't currently thinking about multiple ASP.Net frontends, there's probably no need to spin off the static files yet unless we're talking multiple gigabytes of files.
If you're serving files over the Internet, you might also consider Amazon's S3 service. I've found the rates and reliability to be better than anything I could do (or find) on my own.