Cygwin in a Production Environment?
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?"
We have been using cygwin dll to run RSYNC on Windows servers without any issues.
Consensus is good, but informed dictatorship is better
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
If you're just running shell scripts, you're probably going to be able to make the transition with a minimum of effort. Cygwin is a bit slow, though. It's good for most purposes, but don't depend on it to do more than administrative tasks.
At least, in my experience. I use it for development and it makes my life livable.
Services For Unix is now free.
If you use cygwin, make sure to get a better terminal for it. Puttycyg uses Putty's great terminal emulator for cygwin, and it works rather well.
http://home.wanadoo.nl/fvu/Projects/Bash/Web/bash. htm bash & windows faq/howto thingy and perl on windows google search .
world was created 5 seconds before this post as it is.
I would recommend you use ActiveState's Perl distribution in conjuction with the Cygwin enbvironment.
It's reasonably prioed and well supported, without a lot of stuff you *don't* need thrown in.
The difference between stupidity and genius is that genius has its limits.
Much better flamebait would be:
See, I can do a real flamebait!
What about the possibility of either running Linux inside VMWare on a Windows machine or the reverse?
Admission: I don't have recent direct experience with VMWare myself; it used to be that the two systems needed different IP addresses, but I don't know if that would keep within the constraints your customer wants to impose.
[My two cents: the constraint sounds overly artificial. A network-presence appliance that's secure and does its job is good enough for most people. Think of network printers, for example. It's not like every single active IP presence is going to need a Windows XP update...
Finally, I've heard some people express a preference for MinGW over Cygwin for some reason...
"Provided by the management for your protection."
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
Under Windows XP only, cygwin dll has a problem with locking threads after they have terminated.
;do
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
I work for a relatively large Credit Union and we currently run CYGWIN on many of our production servers to communicate with our UNISYS host. It's running in a 24x7 environment and has given us no problems. We do restart the web hosting services once a night (mostly to change log files).
We use it to interface with both Oracle and MSSQL databases. Again we have found little to no problems at all running on production hosts.
They always did the trick for me...
i have a similar issue: i have some semi-RT apps that were written by a vendor for ;-),
WinNT(and XP) - and not having tried either(i'm an end-user, not an admin, so i can't tinker...
there ought to be a good way to utilise one or the other to achieve acceptable results in a
production environment.
before anyone gets all huffy about XP, it is fairly stable, can be configured to be relatively
secure(!) and, a recent LinuxFormat Magazine had a co-linux/Gentoo dist on it.
anyone try either one out? philosophically, i'd prefer to use win4lin, but realise that it may be
more practical to try co-linux because of the peculiarities of XP(wierd system calls, etc.)
"...that's as white as it gets; all the bits are on..."
I already made a post in a thread about SFU 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
-- search the web
If cygwin is not upto production standard, then maybe you can evaluate Unix for Windows - it was originally an ATT labs product - but now seems to have been sold. You can download a non-commercial version for free (as in beer). Check it out at http://www.research.att.com/sw/tools/uwin .
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.
Msys is just an older version of cygwin with some additions that purportedly make it easier to use with mingw.
The last time I checked, msys was slower than cygwin.
I had a similar problem with a customer needing code ported from unix to windows 2000, with some unix specific stuff in the code like forking processes etc. (This was about two years ago)
:)
I looked around for several solutions and came across cygwin, which did the job.
The problem was that at that time it was property of Red Hat [http://www.redhat.de/software/cygwin/support/], who apparently were busy with anything but cygwin. Their website said something about $100.000 or something for a developer license, which was out of the question. Emails I sent were not answered, and i had to abandon the idea.
Similar story with Microsoft. The *one* guy i managed to get hold of wasn't even aware they had a product named Services For Unix. (Hello ?)
Different story with MKS. Unfortunately their toolkit was over-budget too, but at least they were trying to help me, and trying to sell me a product I needed, and very polite and helpful.
(Kudos to miss K.
I hope for their sake they got their act together at Red hat about cygwin now, cause they probably missed an opportunity to make some bucks and more importantly get a foothold in a big japanese electronics company's development division.