Mysterious 15 second startup delay running Wine as www-data

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
happyguy
Newbie
Newbie
Posts: 3
Joined: Thu Mar 25, 2010 5:26 pm

Mysterious 15 second startup delay running Wine as www-data

Post by happyguy »

I'm using Wine to run a text mode cgi-bin Win32 program on Ubuntu 9.10. If I run it under my regular account, or via

sudo -H -u www-data ./mycgi.exe

it runs instantly (< 1 sec.)

When run as a cgi-bin program (therefore as www-data user), there is a (measured) 15 second delay and then the program runs in 350ms and the data is returned to the client.

Any idea what might be causing this mysterious 15 second delay? I can't find anything unusual in the .wine folder (which is under /var/www) According to the package manager, I am running wine1.2 version 1.1.31-0ubuntu3.

The output when run via sudo looks like:

Code: Select all

No protocol specified
No protocol specified
No protocol specified
Content-type: text/html

<head></head><body>Incorrect method used to pass data.</body>
I note there is no carriage return after </body> if that matters.
hellork
Level 3
Level 3
Posts: 82
Joined: Thu Mar 27, 2008 7:13 pm

Re: Mysterious 15 second startup delay running Wine as www-d

Post by hellork »

Just a hunch, but if you have the source for this program you could try compiling it with mingw using the -mwindows switch to remove any DOS command windows. Of course if you could do that you might as well compile it as a native app and save the overhead of running it on wine.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

The startup likely has to do with wineserver. I can't say what it is, perhaps it waits for something to timeout but I have no idea. Or perhaps you don't get much cpu time at all.
jeffz
Level 5
Level 5
Posts: 345
Joined: Thu Mar 13, 2008 10:03 pm

Post by jeffz »

did you check your webserver log?

one guess is that it's looking for an X server
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Post by oiaohm »

happyguy Little blunt point. Wine was not tested or designed or intended to be run the way you are doing.

One of the bugs in wine is that is does not start up at a constant speed. Even as a regular user it can at random take over 20 secs to start. This is not a suitable state for a web server.

www-data run as a normal user has normal console accesses. Running as www-data from a web server does not. Like really want reason does www-data under to know what partitions are on offer.

I guess you have already disabled sound if not some of those seconds will be waiting for time outs on that.

Lot of places wine will be waiting for time outs due not being able to access particular things. Note its not just o well lets give these to wine. This is bugger need to alter wine not to ask for those under particular conditions so you don't create secuirty issues.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Mysterious 15 second startup delay running Wine as www-d

Post by vitamin »

happyguy wrote:If I run it under my regular account, or via
sudo -H -u www-data ./mycgi.exe
it runs instantly (< 1 sec.)
Try:

Code: Select all

sudo -H -u www-data env - wine ./mycgi.exe
Does it start same fast or takes 15 sec?
happyguy
Newbie
Newbie
Posts: 3
Joined: Thu Mar 25, 2010 5:26 pm

Post by happyguy »

Using

sudo -H -u www-data env - wine ./mycgi.exe

it takes 15 seconds to start! So something is wrong with the environment. Hmmm...
Martin Gregorie

Mysterious 15 second startup delay running Wine as www-data

Post by Martin Gregorie »

On Sun, 2010-04-04 at 16:19 -0500, happyguy wrote:
Using

sudo -H -u www-data env - wine ./mycgi.exe

it takes 15 seconds to start! So something is wrong with the environment. Hmmm...
And if you stop and immediately restart it, does it still take 15 secs?


Martin
happyguy
Newbie
Newbie
Posts: 3
Joined: Thu Mar 25, 2010 5:26 pm

Post by happyguy »

It takes 15 seconds every time, even running it right after the previous run.
James McKenzie

Mysterious 15 second startup delay running Wine as www-data

Post by James McKenzie »

happyguy wrote:
It takes 15 seconds every time, even running it right after the previous run.

Networked printers???

James McKenzie
Quix0r
Level 3
Level 3
Posts: 50
Joined: Sat May 10, 2008 8:23 am

Post by Quix0r »

@happyguy: What they are suggesting to you is that you might want to take a look in output of./configure --help what it is not needed for a CGI, big example is OpenGL (LOL?), Sound, scanner, printer, etc. So I mean all that stuff that is maybe needed on "desktop systems" but not on "server systems".

So please execute...

Code: Select all

./configure --help
... and see what --disable-foo you might can add, just to make sure it is not compiled in to save some startup time. :)[/quote]
Quix0r
Level 3
Level 3
Posts: 50
Joined: Sat May 10, 2008 8:23 am

Post by Quix0r »

Damn, quote block is broken. :(
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

happyguy wrote:Using

sudo -H -u www-data env - wine ./mycgi.exe

it takes 15 seconds to start! So something is wrong with the environment. Hmmm...
How about this?

Code: Select all

env - wine ./mycgi.exe
Locked