smbj
smbj copied to clipboard
SMB2 file operations are too slow.
In our application we are using SMBJ library for SMB2 protocol. When we perform any SMB2 file operation, each calls like diskshare.isExists() is very slow. We are observing the slowness as it needs to make the new connection and session object every time and the network latency is high (i.e. SMB server is located in different datacenter).
If we perform the same operation using SMB1 which is implemented using jcifs library, the operations are quite fast (3-4 times faster). This is because the connection and session objects are getting cached and skipped these network calls.
Hence to match the SMB2 performance with SMB1, can someone suggest any workaround or fix for SMBJ library, which can enable caching for connection and session objects for each file operations calls using same share.
Thanks in advance...!!!
It is possible to do multiple actions over the same connection and session. I assume the slowness it most probably in your usage of SMBJ, which is not how it's intended to be used as it does reuse sessions and connections if you keep using the same client.