Many IBM i installations use the operating system’s NetServer facility to present directories in their system’s IFS as standard SMB file shares on their network. These shares can be accessed by Windows client PCs and any other SMB clients that may need to access IFS directories. While it’s common for customers to have a share directly on the /QDLS folder, many don’t know that directly accessing files in /QDLS via a standard NetServer file share can be problematic.
Why isn’t sharing /QDLS as a NetServer file share a good idea?
Multithreading. NetServer is shipped as a multithreaded facility by default for optimal performance. Because /QDLS is an ancient directory technology that can’t support multithreading, any file share connections to /QDLS must be single-threaded.
Suppose an SMB client (e.g., a Windows PC) makes its initial SMB connection to the system via a share on /QDLS. The NetServer server-side connection will be a single-threaded job, and any additional accesses to other IFS directories, outside of /QDLS, will also funnel through that single-threaded connection.
Suppose an SMB client makes its initial SMB connection to the system via a share on a normal IFS share (“normal” is a share on a directory outside of /QDLS). The NetServer server-side connection will be a multithreaded job, and any requests to access /QDLS after that initial connection will fail. Therein lies the fundamental problem with /QDLS NetServer shares.
How do you avoid connectivity issues with shares on /QDLS?
The best practice approach is not to have a share on /QDLS in the first place. Suppose you have code running on your system that requires using the /QDLS folder. For example, you may have a population of old applications that execute CPYTOPCD commands to create ASCII files of database files in /QDLS. A good workaround is to use the /QDLS folder, but after you place files there, have your application move those files from /QDLS to a standard IFS directory outside of /QDLS. This allows the directory to be accessed via its own SMB share that a multithreaded connection on the server side will service.
If you must continue to use a share on /QDLS for whatever technical/application reasons and you’re experiencing the /QDLS connectivity issue described above, another approach — albeit not recommended for performance degradation reasons — is to configure your system to only use single-threaded server-side SMB connections with NetServer.
This approach ensures that client-side connections to a /QDLS share will always work because a single-threaded job on the system will always service the client’s connection attempts. Still, it’ll impact your system’s overall performance of IFS file shares. Single-threaded sessions that support file systems like /QDLS that aren’t thread safe are handled by prestart job QZLSFILE, and multi-threaded sessions that support file systems except /QDLS are handled by prestart job QZLSFILET. To force all SMB client connections to be single-threaded, you need to remove the QZLSFILET prestart job entry from subsystem QSERVER using these steps:
- End NetServer: ENDTCPSVR SERVER(*NETSVR)
- End the QZLSFILET prestart job: ENDPJ SBS(QSERVER) PGM(QZLSFILET) OPTION(*IMMED)
- Remove the QZLSFILET prestart job entry: RMVPJE SBSD(QSERVER) PGM(QZLSFILET)
- Restart NetServer: STRTCPSVR SERVER(*NETSVR)
NetServer will now use only the QZLSFILE prestart jobs (single-threaded) for all SMB client connections. Because the multi-threaded prestart job QZLSFILET entry was removed from the QSERVER subsystem, the QZLSFILET job cannot start when NetServer is restarted. Thus, all SMB connections will be forced into single-threaded connections, and /QDLS connection failures should no longer occur.
If you need to re-enable multithreading for NetServer SMB connections, then execute these steps:
- Add the QZLSFILET prestart job entry back to subsystem QSERVER: ADDPJE SBSD(QSYS/QSERVER) PGM(QSYS/QZLSFILET) STRJOBS(*NO) INLJOBS(1) THRESHOLD(1) ADLJOBS(0) MAXJOBS(*NOMAX) JOBD(QSYS/QZLSPJ) MAXUSE(1) CLS(QSYS/QPWFSERVER)
- Start the QZLSFILET prestart job: STRPJ SBS(QSERVER) PGM(QZLSFILET)
Many shops still use the /QDLS directory in their application/processing environments; however, sharing the /QDLS directory using NetServer has some caveats, and hopefully, you now have some good insight into what those may be.
Topics: