f



Slow Matlab vs. Fast Matlab

I have a Matlab simulation that I run at work that takes 4+ hours.  When I run it from home thru a VPN to my employer it's about 20x quicker!  I'm trying to figure out what the issue could be.

The loading on the computer is about the same at work and at home.  It has to be something related to our computer network at work vs. my network at home, but I'm not sure where to look.

Any ideas?
0
Kevin
12/2/2010 7:24:05 PM
comp.soft-sys.matlab 211266 articles. 24 followers. lunamoonmoon (257) is leader. Post Follow

8 Replies
1537 Views

Similar Articles

[PageSpeed] 32

On 10-12-02 01:24 PM, Kevin wrote:
> I have a Matlab simulation that I run at work that takes 4+ hours.  When
> I run it from home thru a VPN to my employer it's about 20x quicker! I'm
> trying to figure out what the issue could be.
>
> The loading on the computer is about the same at work and at home. It
> has to be something related to our computer network at work vs. my
> network at home, but I'm not sure where to look.

Does the simulation do much graphics? VNC and Rdesktop compresses graphics 
better than X does, so running remotely (even from home) via a VPN can 
sometimes be faster than running from a local network.

One case in which graphics can be significantly faster remotely is that some X 
operations require that the X client (confusingly, the machine the program is 
running on, not the local machine you are sitting at) query the X server 
(confusingly, the machine you are sitting at) and wait for the response. This 
can occur hundreds of times per second, with a round-trip each time. However, 
when you connect to a VNC session, the VNC server is running right at the 
server and those queries do not necessarily really get to the network hardware 
at all, so the queries can be answered quickly. I don't know if it is a design 
fault or a common programming fault, but it is common with X for the *same* 
value to be queried over and over again even though the value is highly 
unlikely to have changed (e.g., screen size)

Note that above my reference to VNC rather than VPN is not a typo; VNC is a 
particular remote graphics program that is common on Unix-type systems. My 
suggestions about why your graphics might be slow are based upon the asumption 
that you are using a Unix-type system. If that is not the case, then please 
let us know what OS you are using on the system that is running Matlab and how 
you are accessing that system from work and how you are displaying remote 
graphics to home.
0
Walter
12/2/2010 8:12:51 PM
Thanks for the reply Walter.

Not a Unix system, unfortunately.  And no graphics to speak of.  I'm running Windows XP and Matlab version 2008b.

I'm running the sim on my laptop (Dell M6400) at work and at home.  Everything is the same at work and at home except how I connect to the network.

Thanks,
Kevin

Walter Roberson <roberson@hushmail.com> wrote in message <id8uk5$k88$1@canopus.cc.umanitoba.ca>...
> On 10-12-02 01:24 PM, Kevin wrote:
> > I have a Matlab simulation that I run at work that takes 4+ hours.  When
> > I run it from home thru a VPN to my employer it's about 20x quicker! I'm
> > trying to figure out what the issue could be.
> >
> > The loading on the computer is about the same at work and at home. It
> > has to be something related to our computer network at work vs. my
> > network at home, but I'm not sure where to look.
> 
> Does the simulation do much graphics? VNC and Rdesktop compresses graphics 
> better than X does, so running remotely (even from home) via a VPN can 
> sometimes be faster than running from a local network.
> 
> One case in which graphics can be significantly faster remotely is that some X 
> operations require that the X client (confusingly, the machine the program is 
> running on, not the local machine you are sitting at) query the X server 
> (confusingly, the machine you are sitting at) and wait for the response. This 
> can occur hundreds of times per second, with a round-trip each time. However, 
> when you connect to a VNC session, the VNC server is running right at the 
> server and those queries do not necessarily really get to the network hardware 
> at all, so the queries can be answered quickly. I don't know if it is a design 
> fault or a common programming fault, but it is common with X for the *same* 
> value to be queried over and over again even though the value is highly 
> unlikely to have changed (e.g., screen size)
> 
> Note that above my reference to VNC rather than VPN is not a typo; VNC is a 
> particular remote graphics program that is common on Unix-type systems. My 
> suggestions about why your graphics might be slow are based upon the asumption 
> that you are using a Unix-type system. If that is not the case, then please 
> let us know what OS you are using on the system that is running Matlab and how 
> you are accessing that system from work and how you are displaying remote 
> graphics to home.
0
Kevin
12/2/2010 8:21:04 PM
"Kevin " <Kevin.Dutton2@honeywell.com> wrote in message <id8rol$bv9$1@fred.mathworks.com>...
> I have a Matlab simulation that I run at work that takes 4+ hours.  When I run it from home thru a VPN to my employer it's about 20x quicker!  I'm trying to figure out what the issue could be.
> 
> The loading on the computer is about the same at work and at home.  It has to be something related to our computer network at work vs. my network at home, but I'm not sure where to look.
> 
> Any ideas?

Can you clarify what you mean by "run it from home thru a VPN"? For instance, are you remotely accessing a computer at work (through windows remote desktop, for example)?

Thanks,
Sven.
0
Sven
12/2/2010 10:34:05 PM
Sure Sven.  I run the simulation on the same laptop at work and at home.  I connect to my employer's intranet through a VPN at home (need the network connection to contact the Matlab license server).  So while I'm at work I'm directly on their network, while I'm at home I connect to their network thru a VPN.

No remote desktop.  Just the same laptop at work and at home.  All needed files are local to my laptop (don't need to get any files over the network).  Same loading on the computer.  Not sure what would be different about these two ways of connecting to the network. 

"Sven" <sven.holcombe@gmail.deleteme.com> wrote in message <id96ss$lnm$1@fred.mathworks.com>...
> "Kevin " <Kevin.Dutton2@honeywell.com> wrote in message <id8rol$bv9$1@fred.mathworks.com>...
> > I have a Matlab simulation that I run at work that takes 4+ hours.  When I run it from home thru a VPN to my employer it's about 20x quicker!  I'm trying to figure out what the issue could be.
> > 
> > The loading on the computer is about the same at work and at home.  It has to be something related to our computer network at work vs. my network at home, but I'm not sure where to look.
> > 
> > Any ideas?
> 
> Can you clarify what you mean by "run it from home thru a VPN"? For instance, are you remotely accessing a computer at work (through windows remote desktop, for example)?
> 
> Thanks,
> Sven.
0
Kevin
12/2/2010 10:47:06 PM
Kevin  <Kevin.Dutton2@honeywell.com> wrote:
> Sure Sven.  I run the simulation on the same laptop at work and at 
> home.  I connect to my employer's intranet through a VPN at home (need 
> the network connection to contact the Matlab license server).  So 
> while I'm at work I'm directly on their network, while I'm at home I 
> connect to their network thru a VPN.
> 
> No remote desktop.  Just the same laptop at work and at home.  All 
> needed files are local to my laptop (don't need to get any files over 
> the network).  Same loading on the computer.  Not sure what would be 
> different about these two ways of connecting to the network.
> 
> "Sven" <sven.holcombe@gmail.deleteme.com> wrote in message 
> <id96ss$lnm$1@fred.mathworks.com>...
>> "Kevin " <Kevin.Dutton2@honeywell.com> wrote in message 
>> <id8rol$bv9$1@fred.mathworks.com>...
>> > I have a Matlab simulation that I run at work that takes 4+ hours.  
>> > When I run it from home thru a VPN to my employer it's about 20x 
>> > quicker!  I'm trying to figure out what the issue could be.
>> > 
>> > The loading on the computer is about the same at work and at home.  
>> > It has to be something related to our computer network at work vs. 
>> > my network at home, but I'm not sure where to look.
>> > 

Sucking resources:

If your IT department is anything like mine it may well be that
they are hammering on your system while you're at work but they
leave it alone when you are connected via VPN.
Take a look at which processes are running in both cases.

networking:
You may also have a hung mount if you use the legacy "drive 
letter" stuff for network shares. If you have any hard mounts
try removing them

Stan
0
Stan
12/3/2010 12:18:07 AM
Thanks Stan.

I took a screenshot of the procexp.exe running at home (a task manager).  I'll do the same at work on Monday and see if there are any noticeable differences.  It would be nice to know what to look for though - what process(es) in particular could be causing the issue?

I do have one network drive that's connected both at home and at work.  I tried to disconnect it at work a few days ago to see if that was the problem, but I wasn't able to disconnect it.

We  do run the McAfee Agent SW, and I do think that hogs a lot of the computer's resources.  Not sure why it would operate differently at home vs. at work.



Stan Bischof <stan@worldbadminton.com> wrote in message <4cf8373f$0$1616$742ec2ed@news.sonic.net>...
> Kevin  <Kevin.Dutton2@honeywell.com> wrote:
> > Sure Sven.  I run the simulation on the same laptop at work and at 
> > home.  I connect to my employer's intranet through a VPN at home (need 
> > the network connection to contact the Matlab license server).  So 
> > while I'm at work I'm directly on their network, while I'm at home I 
> > connect to their network thru a VPN.
> > 
> > No remote desktop.  Just the same laptop at work and at home.  All 
> > needed files are local to my laptop (don't need to get any files over 
> > the network).  Same loading on the computer.  Not sure what would be 
> > different about these two ways of connecting to the network.
> > 
> > "Sven" <sven.holcombe@gmail.deleteme.com> wrote in message 
> > <id96ss$lnm$1@fred.mathworks.com>...
> >> "Kevin " <Kevin.Dutton2@honeywell.com> wrote in message 
> >> <id8rol$bv9$1@fred.mathworks.com>...
> >> > I have a Matlab simulation that I run at work that takes 4+ hours.  
> >> > When I run it from home thru a VPN to my employer it's about 20x 
> >> > quicker!  I'm trying to figure out what the issue could be.
> >> > 
> >> > The loading on the computer is about the same at work and at home.  
> >> > It has to be something related to our computer network at work vs. 
> >> > my network at home, but I'm not sure where to look.
> >> > 
> 
> Sucking resources:
> 
> If your IT department is anything like mine it may well be that
> they are hammering on your system while you're at work but they
> leave it alone when you are connected via VPN.
> Take a look at which processes are running in both cases.
> 
> networking:
> You may also have a hung mount if you use the legacy "drive 
> letter" stuff for network shares. If you have any hard mounts
> try removing them
> 
> Stan
0
Kevin
12/3/2010 2:26:04 AM
"Kevin " <Kevin.Dutton2@honeywell.com> wrote in message <id97la$b09$1@fred.mathworks.com>...
> Sure Sven.  I run the simulation on the same laptop at work and at home.  I connect to my employer's intranet through a VPN at home (need the network connection to contact the Matlab license server).  So while I'm at work I'm directly on their network, while I'm at home I connect to their network thru a VPN.
> 
> No remote desktop.  Just the same laptop at work and at home.  All needed files are local to my laptop (don't need to get any files over the network).  Same loading on the computer.  Not sure what would be different about these two ways of connecting to the network. 


Hmmm... well that's interesting. As others suggest, check the cpu usage at home/work and see if there's a noticeable difference (it would need to be for 20X speed increase).

I'd say if you want to get to the bottom of it, work on a systematic way to do so. Try to recreate the phenomenon with a simple test that takes just a few seconds, then go nuts turning things on and off.

Maybe try using the VPN to get the MATLAB license, then disconnect before running. Maybe try it with any of your network drives connected/disconnected (I've had speed issues with network drives, but that was when writing to them specifically).

Good luck!
0
Sven
12/3/2010 2:32:04 AM
Kevin  <Kevin.Dutton2@honeywell.com> wrote:
> Thanks Stan.
> 
> 
> I do have one network drive that's connected both at home and at work.  
> I tried to disconnect it at work a few days ago to see if that was the 
> problem, but I wasn't able to disconnect it.
> 

I've seen major slowdowns from hung mounts- and this sounds
like one. What happens with legacy "drive letter" stuff (
OK back in the 90's but definitely obsolete in the modern world )
is that if the share is unavailable for any reason and the
OS is looking for it, there's a timeout for any network
activity. Have seen many times where an app does frequent
network access ( like checking licenses) one sees major slowdown due
to the frequent timeouts.

Very possible that this could be your problem. Get rid
of that mount any way you can and try again.

This is one of the reasons I pretty much never use the legacy
"drive letter" hard mounts.

Stan
0
Stan
12/3/2010 3:06:17 PM
Reply: