MikeA
Thu Sep 20 09:36:56 PDT 2007
I have just done some more research and this is really perplexing to me.
Here's what I found out. I played around with my memo field and I noticed
that regardless of the number of lines in the memofield the slowness is due
to the length of the memo field. The slowness (as per my prior posts) only
occurs when the file is opened for shared use. It takes less than one
second to open the form if the memo field is 500 characters or less. Once
the memo field is more than 500 characters it takes a whopping 11 seconds to
open the form (but only when it is opened for shared use).
What's that all about? Why is that happening? I have determined this has
nothing to do with my code and appears to be strictly a function of the
length of the memo field. Is that possible? Does anyone have any ideas as
to why this could be?
Thanks,
Mike
"Cy Welch" <cywelch@hotmail.com> wrote in message
news:E2EEC760-EE82-4B52-B2AF-2D7E9664714E@microsoft.com...
> As you have been told that is normal behavior. When the table is open by
> more than one computer VFP MUST check the record on disk each time you
> access any field. If it's only open on one computer, it pulls it into
> memory and doesn't look back at disk. It's pretty normal for database
> access across the network to take as much as 10 times longer under
> multiuser. Part of best practices over a network is to not do more reads
> across the network than needed. In other words, always read everything
> into memory and then read from memory unless you expect the values to be
> changed. If everything only reads from the table you might be able to get
> pretty much the same increase in speed if you open the table read-only as
> it doesn't have to worry about locking in that situation which is what
> slows access down.
>
> --
> Cy Welch
> Senior Programmer/Analyst
> MetSYS Inc.
>
http://www.metsysinc.com
>
> "MikeA" <appell@appellsoftware.com> wrote in message
> news:dEdIi.17429$re2.14254@trnddc02...
>>I still have a feeling something else is going on here. I'll check
>>because I have another client that has an XP PRO they are using (for the
>>file server). I don't think their network has this problem but I'm going
>>to go over there today to double check this. I just can't see being able
>>to open a form in under one second and then if I have that same table open
>>on a second workstation that it could then take some 5-10 seconds to open
>>that same form. The table is only one record and the dbf is 11K and the
>>fpt is 15K. The only good news is that I hae simulated the same problem
>>here on my network as well.
>>
>> Mike
>>
>>
>> "Dan Freeman" <spam@microsoft.com> wrote in message
>> news:%23Ec71Uu%23HHA.2004@TK2MSFTNGP06.phx.gbl...
>>> ALL data access is slower when multiple users are involved. It *has* to
>>> be.
>>>
>>> VFP cannot rely on its local cache. It must first ask Windows to poll
>>> the network to see if other users have cached changes that must be
>>> updated to the server and then updated to the local cache.
>>>
>>> It's the nature of the beast. Some networks will handle it better than
>>> others. In your OP you mentioned a "Windows XP server" -- Windows XP is
>>> not a server operating system. I'd expect it to be the least capable
>>> "server" of the lot because it isn't one. ;-)
>>>
>>> Dan
>>>
>>> MikeA wrote:
>>>> Thank you all for your replies but I think you may be missing what I'm
>>>> asking. I understand that the memofield access can be slow
>>>> especially if the memofiled is large. However, my memofield is no
>>>> more than 3K but does contain around 150 lines. My question is why
>>>> is it so much slower when the file is open at another workstation on
>>>> the network, otherwise, it is very fast to loop through the memofield.
>>>>
>>>> My question is whether it is normal for the memofield access to be
>>>> very fast when accessing it over a network on workstation #1. But,
>>>> very slow if the table is open at another workstation on the network?
>>>> I noticed that it is definitely a lot faster when I simply copy the
>>>> memofield to a variable and then access the lines via the local
>>>> variable.
>>>> So, say I have 3 computers (one is the file server). I open the
>>>> table and it is slow to do multiple accesses of the memofield but
>>>> only if it is open on another computer. My fear is that all data
>>>> access may be slowing down but not enough to detect with the eye and
>>>> that maybe there is something else I'm not noticing. I have not used
>>>> Set Refresh so that is just using the default and I am opening the
>>>> table via pessimistic locking but nothing is not locked on the reads.
>>>> It's just the multiple accessing via the memofields when the table is
>>>> open at another workstation that slows everything down. Also, I
>>>> don't think this is happening on all LANs and may depend on the
>>>> server and network setup. But, it does appear to be happening on
>>>> some so it really has me curious.
>>>> Thanks,
>>>> Mike
>>>>
>>>>
>>>> "Alex.K" <nomail@nomail.com> wrote in message
>>>> news:%23k5ccbt%23HHA.1184@TK2MSFTNGP04.phx.gbl...
>>>>> Mike,
>>>>>
>>>>> You should only read the Memo field once and store it to a string
>>>>> var. Then do all processing on the string. You can also use _MLINE
>>>>> and MLINE() on strings.
>>>>>
>>>>> Another method is to use ALINES() and process as an Array
>>>>>
>>>>>
>>>>>
>>>>> - Craig
>>>>>
>>>>> "MikeA" <appell@appellsoftware.com> wrote in message
>>>>> news:JA5Ii.7361$A72.1856@trnddc08...
>>>>>> Anyone have any ideas about this: here's the situation,
>>>>>>
>>>>>> I have a memo field that I use in a table and I read various lines
>>>>>> from the memo field for default settings. This makes it so that I
>>>>>> don't always have to modify the structure of the table. The total
>>>>>> length of the memofield is small (under 3K). However, I have to
>>>>>> read the memo field multiple times to get the default values on any
>>>>>> particular line. For example:
>>>>>>
>>>>>> set memowidth to 8192
>>>>>> test1 = mline(mytable.mysettings, 1)
>>>>>> test2 = memline(mytable.mysettings, 2)
>>>>>> test3 = memline(mytable.mysettings, 3)
>>>>>> test4 = memline(mytable.mysettings, 4)
>>>>>>
>>>>>> There are about 150 lines at present in the field. Here's the
>>>>>> strange thing. I have a method in a form that reads all the values
>>>>>> and sets the objects on the form accordingly. It seems like it is
>>>>>> starting to take a long time to load the form (around 6-10
>>>>>> seconds). But, this delay is ONLY PRESENT if the table is open on
>>>>>> another computer on the network. If I open the table on the same
>>>>>> computer in a separate program (such as VFP) or I run another
>>>>>> instance of my application, then everything is fast. The slowness
>>>>>> only happens if the table is open on another workstation and it
>>>>>> appears that it is just as slow if the table is open on 2
>>>>>> workstations or 10 (makes no difference). It drastically speeds up
>>>>>> when the table is open on only one workstation and is fast even if
>>>>>> that table is open on one computer with multiple programs (such as
>>>>>> if it is open in my app as well as open in VFP). I have noticed this
>>>>>> problem on both an XP Pro computer (as the
>>>>>> server) with XP workstations and I have also noticed this problem
>>>>>> on a real Win 2000 server with XP workstations. I'm using VFP
>>>>>> 6/SP3. The problem only seems to happen when doing multiple reads
>>>>>> from the same memofield many times. In other words, if I do this
>>>>>> instead: m.lcMain = mytable.mysettings
>>>>>>
>>>>>> and I then populate the form using m.lcMain then everything is very
>>>>>> fast. It's as if multiple reads to the same memofield is really
>>>>>> slow but only if the table is open on another workstation. There
>>>>>> are no virus checkers or other programs (that I know of) to slow it
>>>>>> down). I can't understand why this is happening but I'm not sure
>>>>>> if it is happening on other server OS's as well or just these few
>>>>>> examples I have provided. I'm running the exe on the local
>>>>>> machine. But, it seems to be some kind of network issue because
>>>>>> the speed drastically slows down (reading the memo field multiple
>>>>>> times) whether the table is open on two workstations or 10. It's
>>>>>> then pretty much the same slow speed when open at 2 computers or
>>>>>> more but lightening fast when open at only one. Anyone have any
>>>>>> ideas? Thanks,
>>>>>> Mike
>>>
>>>
>>
>>