slowness

User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

slowness

Post by MarcoBoschi »

Hi,
this little example executed in a lan environment in which the server is linux, microsoft or simply a shared folder from a windows 10 client, highlights that if the dbf table is open from another user in another pc or even in the same pc the execution speed is very very fast. The same speed as when the dbf table is opened only by this program.
Things also change a lot when the cdx file is opened in addition to the dbf file.
The execution speed decreases an half second till five six seconds
I'd like to know which is the problem, if we can talking of problems or if is normal this enormeus difference of speed. In my opinion is not normal.

recap:
- DBF AND CDX OPENED FROM ANOTHER USER SLOW
- ONLY DBF OPENED FROM ANOTHER USER: FAST
- DBF AND CDX OPENED ONLY FROM ME

I understand that indices are fundamental but they are very heavy. I hope I'm doing something wrong

Many thanks to all

Marco

Code: Select all | Expand

ANNOUNCE RDDSYS


FUNCTION MAIN( )

CLS
SET DELETED ON
SET EXCLUSIVE OFF


SET AUTOPEN OFF
DO WHILE .T.

   nInizio := SECONDS()

   SELECT 0
   USE m:\marco\JALA
   SET INDEX TO m:\marco\JALA
   GO TOP


   ? SECONDS() - nInizio
   nInizio := SECONDS()

   DO WHILE !EOF()
      @ 10 , 10 SAY field->bol_lav
      SKIP
   ENDDO
   ? RECNO() , SECONDS() - nInizio

   IF INKEY( 1 ) = 27
      EXIT
   ENDIF

   USE

ENDDO


RETURN NIL


INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
RETURN

 
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7884
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: slowness

Post by karinha »

Code: Select all | Expand

// BOSCHI.PRG

FUNCTION Main()

   CLS

   CLEAR MEMORY

   HB_GCALL( .F. )

   SET DELETED ON
   SET EXCLUSIVE OFF
   SET MULTIPLE OFF
   SET OPTIMIZE ON

   WHILE( .T. )

      nInizio := Seconds()

      SELECT 0  // ??  1 ?

      USE m:\marco\JALA          // ???
      SET INDEX TO m:\marco\JALA

      GO TOP

      ? Seconds() - nInizio

      nInizio := Seconds()

      WHILE( .NOT. EOF() )

         IF EOF()

            EXIT

         ENDIF

         @ 10, 10 SAY FIELD->Bol_Lav

         SKIP

      ENDDO

      ? RecNo(), Seconds() - nInizio

      IF Inkey( 1 ) = 27

         EXIT

      ENDIF

      USE

   ENDDO

   HB_GCALL( .T. )

RETURN NIL

INIT PROCEDURE RddInit

   ANNOUNCE RDDSYS

   REQUEST DBFCDX, DBFFPT

   rddSetDefault( "DBFCDX" )

RETURN

// FIN / END
 
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: slowness

Post by MarcoBoschi »

Karinha,
I tested your code unsuccessful.
Very quickly if I work alone with dbf and cdx and very slow if the dbf and cdx tables are open from another user.

Many thanks anyway

Marco
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7884
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: slowness

Post by karinha »

Marcos, is the database very large? Is the Network via WiFi? Is the network card old?

Marcos, ¿la base de datos es muy grande? ¿La Red es vía WiFi? ¿La tarjeta de red es antigua?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: slowness

Post by MarcoBoschi »

Directory di M:\marco

11/09/2024 00:00 781.312 JALA.cdx
29/08/2024 13:33 6.525.890 Jala.dbf
29/08/2024 13:33 1.051.968 Jala.fpt

cable 1.0 Gbps

LAN_SpeedTest.exe
Bits per seconds
Writing 365,793,632
Reading 720,237,968
Marco Boschi
info@marcoboschi.it
User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: slowness

Post by Jimmy »

hi Marco,

this is the normal SMB behavior.

when DBF is used in Share Mode only Once, it will use SMB "Exlusive Locking" Mode
as soon when DBF was opened second Time it will switch into "Opportunistic Locking" Mode https://learn.microsoft.com/de-de/windo ... stic-locks
it have to do with Cache which in "Opportunistic Locking" Mode is much slower while must take Care when Data is opened by Different Clients.

so open DBF only when need and close it as soon as possible in Network to get max Performance,
greeting,
Jimmy
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: slowness

Post by MarcoBoschi »

Jimmy,
remember this: if CDX files is not open the speed is the same. It's a problem concerned with the use of index files.
Why only for cdx files opened?

Many thanks for your eplanation.
Marco Boschi
info@marcoboschi.it
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: slowness

Post by MarcoBoschi »

I forgot to say that this dbf table is the PBX CDR and it is open 24/7. Bye
8)
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7884
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: slowness

Post by karinha »

Marcos, you need to turn off the machine to free up the memory at least once a day for at least 10 minutes.

Marcos, necesitas apagar la máquina para liberar memoria al menos una vez al día durante al menos 10 minutos.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: slowness

Post by MarcoBoschi »

Is not possible Karinha it's a server
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7884
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: slowness

Post by karinha »

MarcoBoschi wrote:Is not possible Karinha it's a server
Así que será mejor que recomiendes un segundo SERVIDOR, tipo BACKUP para que puedas hacer la parada técnica en el SERVIDOR PRINCIPAL.

So, you'd better recommend a second SERVER, like BACKUP so that you can make the technical stop on the MAIN SERVER.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Jack
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: slowness

Post by Jack »

Hi,

Same problem as you .

It is time to go to SQL .

Philippe
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: slowness

Post by MarcoBoschi »

Hi,

Same problem as you .

It is time to go to SQL .

Philippe
too difficult for me and to much time and Im and old man
Marco Boschi
info@marcoboschi.it
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: slowness

Post by MarcoBoschi »

Marcos, you need to turn off the machine to free up the memory at least once a day for at least 10 minutes.
I will try!


Thanks
Marco Boschi
info@marcoboschi.it
User avatar
Otto
Posts: 6378
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: slowness

Post by Otto »

Marco, how many users are accessing simultaneously? How large are your databases?
It’s hard to give advice without knowing the specifics.
I also noticed back then that when SMB-2 is enabled and you still have older Windows versions running on the network at the same time, it becomes extremely slow.
We always disabled SMB-2 back then. Jimmy posted a good guide at that time.
Why don’t you switch to Remote Desktop?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Post Reply