A credit based queue scheduler dynamically adjusts credits depending upon at least a moving average of incoming packet size to alleviate the impact of traffic burstiness and packet size variation, and increase the performance of the scheduler by lowering latency and jitter. For the case when no service differentiation is required, the credit is adjusted by computing a weighted moving average of incoming packets for the entire scheduler. For the case when differentiation is required, the credit for each queue is determined by a product of a sum of credits given to all queues and priority levels of each queue.