Any hole put in structural timber needs to be put in the center of the joist. That is where the compression and stress are less with a given size of timber. This also depends on the length of span of the joist, it's cross-sectional area and what it is holding up.