Image quality in positron emission tomography (PET) is limited by the number of detected photons. Heavier patients present higher photon attenuation levels, thus increasing image noise. In this work, we propose a new method that uses the combined patient attenuation/system matrix together with a tracer uptake prediction model to optimize scan times for different bed positions in whole body scans. Our main goal is to achieve consistent noise levels across patients and anatomical regions. We propose to optimize scan times for individual bed positions, for patients of any size, based on the scanner sensitivity and patient-specific attenuation. Variable scan times for every bed position were determined by combining the system matrix, derived from the computed tomography (CT) and the scanner-specific geometric sensitivity profiles, and estimations of the global tracer uptake for each patient. The method was validated with anthropomorphic phantoms and whole-body patient 18F-FDG PET/CT scans, where variable and fixed times were compared. Phantom experiments showed that the proposed method was successful in keeping noise level constant for different attenuation setups. In real patients, image noise variability was reduced to less than one-half compared with conventional fixed-time scans at the expense of a four-fold increase in scan times between the biggest and smallest patients. Our method can homogenize image quality not only across patients of different sizes but also across different bed positions of the same patient.