Cygwin in a Production Environment? 111
not-so-anonymous Anonymous Coward asks: "I'm working for a company that does all of its programming and script development in a Unix environment (90% of our work is either Bash or Perl scripts that communicate with an Oracle database). We've recently gotten a new customer and for reasons beyond our control, the server must be a Windows box. Since we want to reuse our existing scripts that we've spent a considerable amount of time developing, we're looking into Cygwin as an option. Has anyone run Cygwin in a production server environment for any extended period of time? If so, what were your experiences with it?"
using cygwin to run RSYNC (Score:3, Informative)
PostgreSQL on cygwin (Score:5, Informative)
cygwin is a really nice emulation layer, but it is an emulation layer and is not 24x7 ready. The timekeeping and IPC mechnisms aren't fully reliable for production-ready use, IMHO. It is amazing for what it does.
We've been running several production PostgreSQL-on-cygwin servers and have been experiencing random corruption and poor timekeeping. There's a bug (hopefully fixed now) in cygwin timekeeping that causes a rollover after 49 days of uptime. PostgreSQL on cygwin also experiences odd table and index corruption problems that I've never seen with it on Linux/FreeBSD.
We're cutting to Oracle for business reasons, or we'd switch to the newly free Win32 PostgreSQL ASAP.
Have you considered MS' Services for Unix? We've not used it, but I'd be interested in hearing about how well it works.
- Barrie
What are you doing with it? (Score:4, Informative)
At least, in my experience. I use it for development and it makes my life livable.
SFU? (Score:5, Informative)
Re:What are you doing with it? (Score:4, Informative)
If the Windows environment becomes that much of a problem (and don't forget to try, as another poster suggested, things like Services For Unix (SFU)), set up a demo of the two things side by side to show the customer just how much more efficent running it on the Unix of your choice is than making it run on Windows. That might convince them if it comes to that.
Speaking of which, I would love to know WHY the client has to have Windows. Maybe there is something there that you can deal with that you don't realize.
Re:cygwin terminal (Score:4, Informative)
C:\cygwin\bin\rxvt.exe -e ssh-agent bash --login -i
IIRC, rxvt isn't installed by default, but it's available under 'shells' when you run the cygwin setup.
Larger thoughts... (Score:5, Informative)
However, in a larger context:
Uhhh, you are taking on a customer for whom you have no tools and no infrastructure for? Who doesn't fit your current model, and fundamentally doesn't fit how you do business? Unless you are laying the ground work to bring in lots more revenue at a lower cost in the future, this might be stupid to do.
Now, a company has to grow, but remember the princepal that says, "Not all customers are profitable". You don't want customers who don't make you money. I remember a story about an advertising company that eliminated 70% of their existing customers and have revenue plumet, but their profits jumped by 30% (as a dollar value, not as a percentage of revenue, they made 2.5Mil instead of 1.5Mil in profit, I believe revenue went from 30Mil to 12Mil).
I know on more then on occasion, the smartest thing the guys in charge where I work is to fire customers. Some customers aren't worth the time or the trouble to deliver service to.
This isn't an anti-Window post, it's merely a matter of considering weather or not this is an area you are planning to expand into, or if this is a one-off, non-scalable solution for a single customer just to get the business.
We run into this quite often, around it's driven by sales people whose sales goals are about bringing in revenue, not bringing in profit. If it costs us $1000 in to bring in $500 in revenue, that's a stupid business proposition. If it's a big chunk of revenue, and you can build it while making money go for it.
Kirby
Cygwin Threading problem (Score:5, Informative)
If you spawn a bunch of processes (such as in a common loop), each of those will use up at least 1 TID. Any call to create new threads made through the cygwin dll makes that TID non-reusable in windows, and will eventually crash your box.
Shell Script that crashes your box:
integer i=70000
while ((i -= 1))
echo hello\\nworld | cat|cat|cat|grep h >&- #spawn some processes
done
While cygwin has its problems, I've had many more w/ Services for UNIX
24x7 (Score:5, Informative)
I already made a post [slashdot.org] in a thread [slashdot.org] about SFU [microsoft.com] that was looking like (disclaimer: i love cygwin):
Now bout your particular problem (prod env, 24x7), I've experienced very few problems running CygWin in such an environment. I use it since at least 5 years (I remember downloading it at 56k, so it's probably more), but there's some things you need to be aware with cygwin:
<Job ID="MyJobID">
<script language=PerlScript>
#
</script
Unix for Windows from ATT (Score:2, Informative)
GPL Warning (Score:3, Informative)
If you can get past the horrible, horrible installation, Cygwin is a pretty nifty piece of kit.
However, in a commercial environment there is one tremendous downfall to using Cygwin. The Cygwin.dll library that does all of the translation from Unix to Windows system calls is under the GPL. NOT the LGPL. This means that if you write an application and build it against the Cygwin libraries and plan to distribute it, the only license you can legally put your software under is the GPL. This is the only case of the "virulent" nature of the GPL that we've witnessed firsthand and I must say it is a particularly nasty one.
For more info:
read the FAQ [cygwin.com].
Re:using cygwin to run RSYNC (Score:2, Informative)
Cygwin will do much more, though - apache, postgresql(probably mysql too, but I haven't seen it), etc. - almost any unix app you can get the source for, you can compile(and use) in Cygwin.
I keep getting in jobs that require the use of windows. I'm a unix guy. I retain my sanity by doing everything in cygwin. I'm wasting an exceed license right now because while they can require that I have it installed, I greatly prefer cygwin X and fvwm. I build most of my applications in shell or perl, sometimes with fakes of the unix apps they'll run against, to feed in the inputs or take the outputs.
Specifically, you say your product is mostly Perl and bash? You write in two of the most-portable languages of all, and you're worried? Jeez, man, it's RedHat! I assume you're using db::oracle or some such perl module for your fancy work. Your porting is likely to be no porting at all, i.e., you'll probably be able to scp your stuff in and just run it without further work. The ease of acquisition and configuration of the platform is such that determining details is honestly trivial. Install, run, try your apps, tell us what you find out.
Re:The Cygwin vs MinGW thing (Score:2, Informative)
The last time I checked, msys was slower than cygwin.
Re:What are you doing with it? (Score:3, Informative)
UNIX is designed in such a way that process creation is very cheap, therefore lots of UNIX programs use fork to achieve parallelism. OTOH, Windows is designed around the threading model, so no particular attention has been made to make process creation similarly cheap.
More info at this link [robelle.com] and this one [geeksalad.org].
--
Re:GPL Warning (Score:3, Informative)