This paper is devoted to dimensioning and optimizing optical buffers for asynchronous, variable length packets in GMPLS-based WDM optical packet-switched networks, which aims to lower network congestion and increase utilization efficiency of optical buffers. In GMPLS-based WDM optical packet-switched networks, the critical issue is how to improve network flexibility and limit network congestion. Comparing to optical buffers with a single operating wavelength, WDM optical buffers in an optical packet switch (OPS) have demonstrated superior performance in solving congestion, which perform buffering by exploiting both time and wavelength dimensions. However, the realistic buffering capacity of optical fiber-delay-line (FDLs) buffers is currently limited. Hence, the algorithm for wavelength sharing and design of the optimal value of the basic time unit of the FDLs in WDM optical buffers are indispensable to shorten FDLs and put OPS into practice. In this paper, the algorithm for wavelength sharing among multiple connections is proposed, which aims to minimize congestion and shorten the queue length. And, in this scenario, the optimal value of the basic time unit of the FDLs is designed. Finally, the proposed algorithm is compared with others in terms of performance.