Transcript
Page 1: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

1

TheUltimateCitrixprintinginternalscheatsheet!Auserclicksprint,whathappensnext?WhenCitrixisthrowninthemixthingsworkabitdifferently.AlthoughtheMicrosoftprintbasicsstillapply,andI’lldiscussthemshortly,thewaythatprinttrafficwill,orcanbe,routedthroughoutyourenvironmentdependson,one:thephysicalsetupofyourmachinesand,two:theCitrix(print)policiesconfigured.DuenotethatIwillonlyfocusonnativeCitrixprinting,andwon’tgooveranyofthethirdpartysolutionsoutthere.IntroductionThroughoutpart*oneI’dliketospendsometimeonthevariousprintfileformatsused,theprintdriversinvolved,somehistory,theMicrosoftprintingbasics,whereCitrixfitsinandsoon.Whileinpart*twoIwillfocusontheactualprintingpathways,howprinttrafficgetsroutedthroughoutourenvironment,whentousewhich,someprosandcons,theuniversalprinter,printserveranddrivers,includingsomespecificarchitecturalsetups.ParttwowillalsoincludealistofallCitrixbestpracticesandrecommendations’includingsometipsandtricksfromthefield,troubleshootingtoolsandalinktothe.PDFdocumentcontainingthecompleteprintingcheatsheet.*Itgoeswithoutsayingthatpartoneandtwoaremergedwithinthisdocument.YouwillnoticethatIhavedeletedsomeimagesaswellasafewparagraphs.Ialsoslightlyadjustedtheoveralllayout,lookandfeel.Contentisstillthesamethough.MicrosoftprintfileformatsFirstthingsfirst.Microsoftsupportstwoso-calledprintfileformats,EMFandXPS.EMFstandsforEnhancedMetaFileandXPSstandforXMLPaperSpecification.Aprintfileformatbasicallyreferstothetypeofprintoutputanapplicationproducesandhowitwillbehandled(routedandrendered)afterwardsbytheprintsubsystem.Althoughconsideredlegacy,EMFisstillwidelyusedtoday,perhapsmosteven.ThisismainlybecauseuptillWindowsXPandServer2003thisisallwehad,soyoucanprobablyimaginethenumberofapplicationsthatdependonEMF.XPSgotintroducedlaterwithVistaAndServer2008.Thewayanapplicationiswritten,orcoded,compiledetc.willdeterminewhichprintfileformatwillbeused.Win32(WindowsAPI)applications,meaningthattheyarebasedonaC-Basedframeworkforcreatingapplications,dependonandleveragetheEMFprintfileformat.WPF(WindowsPresentationFoundation),representingagraphicalsubsystemforrenderinguserinterfacesinWindows-basedapplications,usestheXPSprintfileformat.Asyouwouldexpectbothbehavesomewhatdifferent.

Page 2: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

2

SomemoredifferencesbetweenthetwoXPSappliescompressionbyzippingtheprintdataintoa.zipfile.EMFdoesnotapplycompressionatall.Also,EMFneedstoseparatelydraweachimageitencounters,eveniftheimageisusedmultipletimeswithinthesamedocument.XPShowevercanreferenceasingleimagemultipletimes.ForXPStobeused,assumingyourapplicationssupportsit,boththeprintdriveraswellasthephysicalprintdeviceitselfneedstosupportXPS,otherwiseitwillbeconvertedbacktoEMF.AfterauserclicksprintAgain,thisisstillfromaMicrosoftprintingperspective.Onceauserclicksprinttheapplicationwillproducesomeformofprintoutput,a.k.a.printdata.Thisdatawillcontainallcharacters,fonts,colorschemes,imagesandsoon,whichwillthenneedtobe‘translated’intosomethingthatthephysicalprintdevicecanunderstandandhandle.Asexplainedabove,dependingonhowtheapplicationiswritten/coded,thisdatawilleitherbeEMForXPSbased.WithEMFtheprintoutputwilleitherbeprocessedbytheGDI(GraphicalDeviceInterface)turningitintoametafile(XMLbased)oritwill,togetherwithalocallyinstalledprintdriverrenderthedataintoaprintableformatbeforehandingitovertothe(localorremote)printspoolerservice.However,withEMFGDIinterventionismostcommon.WithXPS,theearliermentionedprintoutputisalreadyinanXMLformatandwillbesendovertotheprintspoolerservicerightaway.SeeImagebelow.

Page 3: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

3

Fromtheretheprintdatawill(again)behandedovertoalocallyinstalledprintdriverfurtherrenderingthedata(ifneeded)whichwillturnitintoanactualprintjobbeforesendingitbacktotheprintspoolerservice.Duringthisphaseitwillalsodetermineiftheso-calledtargetprinterislocallyattachedorremotethroughaprintserverbeforesendingitovertotheactualphysicalprintdevice.PrintSpoolingTheprocesswheretheapplicationprintoutputisreceivedbythespoolerservice,whichhandsitovertoaprintdriverrenderingitintoaprintjobandsendsitbacktothespoolerserviceandthenovertothephysicalprintdevice,iswhatweactuallyrefertoasprintspooling.Ofcoursethisisstillsomewhathighlevel,butitdoesgiveyouagoodindicationonwhatistakingplaceunderthehood.LocalandremoteprintspoolingWhen,fromaclientperspective,printspoolingtakesplacelocallyitwillalsoconsumelocalresources.Forexample,onapcwithalocallyattachedprinterspoolingwillbelocaltotheclient.Whenthatsamepcusesanetwork-provisionedprinter,connectedthroughaprintserverforexample,spoolingwilltakeplaceremotelyontheprintserver,alsomeaningitwillconsumeremoteresourcesontheprintserver.AnotherexamplewouldbewhenwehaveasessiononaXenAppserver,herewewouldalsohaveanetworkprovisionedprintermeaningthatfromaclientperspectivespoolingwilltakeplaceremotelyonaprintserver.Whenspoolingremotely,notonlywillremoteresourcesoftheprintserverbeused,itwillalsogenerateacertainamountofnetworktrafficbetweentheclient(whichcanbeaXenAppserver)andtheprintserveroneachindividualprintjob.Youneedtotakebothintoaccountwhensizingyourprintarchitecturesetup.SomehistoryIfwelookbackacoupleofyears,andperhapseventoday,thenmostprintissueswererelatedtobadlywrittenprintdrivers.Theywerenotoptimizedformultiuserenvironments,nottestedorsigned,serviceswouldhang(spoolerenCitrixPrintManager)bluescreenswouldpopup,theautocreatingofprinterswouldfail,wewouldexperiencehighCPUloadsandsoon.BackintheWindowsNTdaysallwehadweresocalledversion2kernelmodedrivers.Whichofcourseraninkernelmode.Itisn’tthathardtoimaginewhathappenedifoneofthosedriverswentbad.Youwouldsimplyloosethewholesystemandeverythingonit.LuckilywithWindows2000cameversionthreeusermodedrivers,whicharestillwidelyusedtoday.Nowwewouldonlyusetheusermodesectionofaserverifsomethingweretogowrongwithonofthosedrivers.Althoughthisstillbasicallyleavestheserveruseless,theimpactislessthenthewithkernelmodedrivers.

Page 4: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

4

WithWindowsServer2008R2Microsoftintroducedamechanism,whichautomaticallyblockstheinstallationofversion2kernelmodedrivers,agoodthing.TheyalsointroducedafeaturenamedPrintDriverIsolationanditcandoexactlyasthenameimplies,isolateyourprintdrivers.WithPrintDriverIsolationyouhavethreeseparatemodestoconfigureandapply,None,SharedandIsolated.PrintDriverIsolationWiththeNonemode(whichwillbeappliedbydefault)nothingchanges,alldriverswillstillbeabletointeractandifonegoesbaditcanstillpotentiallybringdownthewholemachine,orthebiggestpartofitanyway.WithSharedmodehoweverwehavetheabilitytogroupacertainamountofprintdriversandletthemruninaprocesscompletelyseparatedfromallotherprintdriversincludingthePrintSpoolerandCTXPrintManagementservice.Theseprintdriverswillrunisolatedinaprocessnamed‘PrintIsolationHost’.Thisalsomeansthatifsomethingweretogowrong,onlythedriverswithinthatisolatedprocesswouldbepotentiallyaffected.AndsinceitalsorunsseparatefromtheSpoolerandCTXPrintManagementservice,itwon’taffectanyoftheotherusersonthesamesystem.

ThesamerulesapplytotheIsolatedmode,onlyheretheisolationpartwillgetappliedonaperprintdriverbasis.Foreachprintdriveraseparate‘PrintIsolationHost’processwillbecreatedandwillruncompletelyseparatefromallotherdriversandservicesasmentionedabove.Thisalsomeansthatmorelocalresourceswillbeconsumedandthusneeded,especiallywhenyouwanttoisolatemultiple,orperhapsdozenseven,printdrivers.Somethingtobeawareoffand

considerbeforeimplementing.Also,andthisisnotjustmetalking,youmightwanttoconsiderwhyaprintdriverneedstobeisolatedfromallothersandifit’sworthimplementingsuchadriverontoyourproductionenvironment,atall.“PerhapsyouarebetteroftouseNoneandSharedmodeinproductionanduseIsolatedfortroubleshootingpurposesonly,whichofcoursecouldapplytoproductionaswell,onlytemporaryVersion4AsoffWindowsServer2012wealsohaveversion4modedrivers,whicharestilluserbasedprintdriversandcanbeisolatedaswell.Sobasicallyalloftheaboveapplieshereaswell.TheyaredesignedtohandlethemoremodernmetrostyleapplicationsandarebasedontheXPSprintfileformatexclusively.Theyaresupposedtosupportalargeramountofdifferentprintertypes,theyaremorestable,orsoIhavebeentold,supportenhancedprintersharingandtheyshouldbealoteasiertoinstallandmaintain.

Page 5: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

5

CitrixPintManagementService Itgotintroducedin2005aroundthesametimeastheEMFbaseduniversalprintdriver.IthandledafewdifferenttaskswithregardstoCTXprintprocess.ForoneitdirectlycommunicateswiththePrintSpoolerservice,whichcaneitherbelocalorremoteinthecaseofaprintserver.

ItalsotalkstothelocalICAclientwhenneeded(usingtheclientprintingpathway,whichisshownintheaboveimage,butwe’llgettothatlater)andcompressesdatabeforeitissendovertheICAchannel,again,whenusingtheclientprintingpathway.It’salsoinchargeoftheICAvirtualchannelforclientprintermapping/creationwithinyourCTXsession.Whichisgoodtoknowwhentroubleshootingautocreateprinterfailuresforexample.What’swrongtoday?Nowthatwe’vetalkedaboutsomeofthe(Microsoft)printspecificsthatcomeintoplaywhendealingwithprintingonaCTXorientatedenvironment,anddon’tworrythere’smoretocome,andwealsocoveredsomeoftheprintdriverhistoryandsoon,whatiswrongtodaywhendealingwithCitrixprinting?We’lltobehonest,notthatmuchhaschanged.Westillhavetodealwithdelayedlogonsandprinting,servicesthatcrash,bluescreens,CPUspikes,autocreationfailuresandmore.AndifwerelatedthesetypesofissuesbacktoCitrixprinting(sincetherecanbedozensofreasonswhyallthismayhappen)theninmostcasesitisstillbecauseoffaultydriversandbadlydesignedorjudgedprintarchitecturesetups.

Page 6: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

6

TheCitrixPrintingPathwaysAprintingpathwaybasicallydefineshowprinttrafficcanorwillberoutedthroughoutourenvironment.Italsotellsuswhereajobgetsprocessed,spooledandsoon.Dependingonthetypesofendpointsweuse,thewayweprovisionprinters,includingthephysicalsetupofourXenAppand/orPrintserverswecanpartlyinfluencehowprinttrafficwillberouted,anduseittoouradvantage.Beforewehavealookatbothpathways,clientandnetwork,I’dliketostartwithasetupreferredtoasserverlocalprinters,seebelow.ServerlocalprintersServerlocalprintersisnothingmorethenattachingaphysicalprinterdirectlytoaXenAppserver.Probablyasetupyouwon’tcomeacrossthatoften,butpotentiallyusefulnonetheless.Fromaclientperspective,whenadocumentisprinted,spoolingwilltakeplacelocally(asmentionedinpartone)ontheXenAppserver,leveraginglocalresources,beforesendingtheoutputtotheactualphysicalprintdevice.Theclient-printingpathwayAlthoughyouhaveafewoptionswithregardstoconfiguringtheclient-printingpathway(we’llgettothatinaminute)thebestwaytoexplainandillustratehowitworkisbyassumingthatalocallyattachedprinterhasbeenconfigured.Bydefaultthereisnoprintserverinvolved.TheclientpartreferstoprinttrafficgeneratedontheCitrix(XenApp)serverbeingredirectedbacktotheclientdevicefromwhereitwillbeforwardedtotheactualphysicalprintdevice.Thisiswhathappens…AuserwillhaveasessionontheCitrix(XenApp)server,assoonasheorsheclicksprinttheapplicationprintoutputwillbespooled/renderedontheCitrixserver(turningitintoanactualprintjob)beforesendingitback(overICA)totheclientdevice.Fromaclient/userperspectivethismeansthatspoolingtakesplacelocally,againleveraginglocalresources.HereitisimportanttonotethatboththeclientdeviceaswellastheCitrix(XenApp)serverwillbothhavetheCitrixReceiver/ICAprotocolinstalled.WhenthespooledprintjobissendbackfromtheCitrix(XenApp)servertotheclientdevicethisisdoneusing,orover,theICAprotocol/channels,andthusthedatasendcanbecontrolled,meaningcompressed,limitedetc.Whichisveryuseful,especiallywhentheclientdeviceandtheXenAppserverarephysicallyseparatedfromeachother.Seeimagebelow.

Page 7: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

7

“Asasidenote,mostthinclientdevicesarebasedonLinux,asaresulttheywillnotbeabletolocallyhandleandprocesstheearliermentionedprintjobs.Asaresultofthis,theclient-printingpathwaywillonlyworkwithWindowsbased(fat)clientdevices.Note…Whenalocallyattachedprinterisconfigured,andagain,thiswillonlyworkonaWindows(fat)clientdevice,theclient-printingpathwaywillbeenforced.Meaningthattheapplicationprintoutput/theprintjobwillalwaysbesendbacktotheclientdevice.Staytunedbecausewehaveafewmore‘usecases’todiscusswhenitcomestotheclient-printingpathway.Thenetworkprinting-pathwayWhenusingnetworkprovisionedprintdevices(printserver)bydefault,Citrixwilltryandusethenetwork-printingpathwaywheneverpossible.Theprocess…AgainasauseryouwillanactivesessionononeoftheCitrix(XenApp)servers.Afterayouhitprinttheprintoutputwillbesendovertotheprintserver(spoolerservice,seepartoneforanoverviewonthis)whereitwillgetspooled/renderedintoaprintjobbeforebeingsendovertophysicalprintdevice.Nowthistime,fromaclientperspective,spoolingwilltakeremotely,leveragingremoteresources.Asapposedtotheclient-printingpathway,hereonlytheCitrix(XenApp)serverwillhavetheReceiver/ICAprotocolinstalled,theprintserverdoesnotknowhow,andisunable,tocommunicateusingtheICAchannels.AsaresultalltrafficsendbetweentheXenAppserverandtheprintserverwillbeunmanagedandthusuncompressed.WhentheXenAppserverandtheprintserveraresituatedclosetogetherthiswon’tbetoobigofanissue.

Page 8: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

8

ButwhentheXenAppserverislocatedinthedatacenterandtheprintserverisneartheusers,inoneofthebranchofficesforexample,thismightcauseapotentialproblem,aswewillseeinanotherexamplecomingup.Anotherthingthatneedstobetakenintoaccountisthattheprintjobsendfromtheprintservertothephysicalprintdevicewillalsobesendinanuncompressedstate.Soagain,whentheprintserverislocatedneartheusers,inthebranchofficeasmentionedabove,thiswon’tbeanissue.Butiftheprintserverislocatedbackinthedatacenter,neartheXenAppserver,thisissomethingtokeepaneyeonaswell.

“Soyouseethatit’snotjustonething,itiseverythingcombinedthatmakesorbreaksyourprintarchitecture.Thetypeofendpointsyouuse,includingthephysicalplacementofyourmachines.

Notethatit’sthesameasbeforeonlyhereIsay‘try’.Thisisbecausewiththenetwork-printingpathwaythereareseveraldependenciesbeforetheactualnetwork-printingpathwaycanandwillbeused.Forexample,iftheCitrix(XenApp)serverandtheprintserverarenitinthesamedomainandareunabletocommunicate,then,insteadofthenetwork-printingpathway,theclient-printingpathwaywillbeused.“Sokeepinmind,thatifthishappensandyouareusingthinclientdevices,chancesarethatprintingwon’tbepossible,atall.

Page 9: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

9

Also,ifforwhateverreasonstheCitrix(XenApp)serverandtheprintserverareunabletocommunicatewitheachother,again,theclient-printingpathwaywillbeusedinstead.Sonowyoumaythink,well,that’snotsobadbecausewhentheclient-printingpathwayisusedmyprinttrafficwillbecompressedsinceitwillleveragetheICAprotocol.Andalthoughthatmightbetrue,thisapproachcanalsoworkagainstyou,asyouwillsoonfindout.Youmayrememberthebelowoverviewfrompartone.

ForcingtheclientprintingpathwayAswe’veseen,whenCitrixisinvolvedandyouareusingnetwork-provisionedprinters,itwillalwaystrytousethenetwork-printingpathwayfirst.However,theremightbesituationswhere,althoughaprintserverisinvolved,youmightprefertheclient-printingpathwayinstead.Forexample,let’sassumethatyourCitrix(XenApp)serverislocatedbackinthedatacenterandthattheprintserverislocatednearyourusers,asI’vealreadyspecificallymentionedafewtimes.Sincetrafficsendbetweenthetwowillbeunmanaged/uncompressedyouwanttobecarefulwiththistypeofsetup,especiallywhenthebranchofficeandthedatacenteraregeographicallyseparated.Whatwecandohereisforcethesystemtoleveragetheclientprinting-pathwayinsteadofthenetworkprinting-pathwaybydisablingthe‘Directconnectiontoprintserver’policy.Bydisablingthispolicyalltrafficwillberoutedthroughtheclientprinting-pathwaybydefault.Interestingright?

Page 10: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

10

Sonow,insteadofsendingtheapplicationprintoutputovertotheprintserveritwillfirstbesendbacktotheclientdeviceovertheICAchannelandthusmanageable(compressed)fromwhereitwillbehandedovertotheprintserver,whichwilltakeoverfromthere.Andsincethosethree,theclient,theprintserverandthephysicalprintdevice,areallclosetogether,thiswillworklikeacharm.

Exceptiontotherule…Andtherealwaysis.Whentheprintserverisbackinthedatacenter,asmentionedandshowninoneofmypreviousexamples,thissetup,usingtheclient-printingpathwayImean,willonlymakethingworse.Havealookbelow.

Page 11: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

11

Herewegoagain…ImagineyouhaveasessionontheCitrix(XenApp)server.Youclickprint.Firsttheprintoutputwillbesendbacktotheclientdevice,overICA,compressedandsoon.Fromthereitneedstofinditswayovertotheprintserver,andsinceitislocatedwaybackinthedatacenteritwillagainneedtotraverstheWAN.Andevenmoreimportantly,itwilldosoinanuncompressedstate.Andfinally,whenrenderedetc.theprintjobneedstobesendtotheactualphysicalprintdevicebackinthebranchoffice.Againgeneratinguncompressedtrafficovertheline.Soyoucanseetheinefficiencyright?Trytoavoidthissetupatalltimes.TheUniversalportfolioThisconsistsoutoftheUniversalPrintServer,theUniversalPrintdriverandtheperhapslesser-knownUniversalPrinter.Let’sstartwithUniversalPrintServer.Ifyouthinkbacktomynetworkprinting-pathwayexamplewheretheprintserverwaslocatedinthebranchofficeandtheCitrix(XenApp)serverinthedatacenter,youprobablyrecallthattrafficsendfromtheXenAppservertotheprintserverwasinanuncompressedsate.TheUniversalPrintServercanhelpustocompressthatdata.Nexttocompressionitisoptimizedfornetworkprintingscenariosandalsoworkswiththinclientandtabletdevices.ItalsosupportsboththeEMFaswellasXPFpintfileformatsandusestheUniversalPrintDriverbydefault,whichcanbepaired/combinedwithanynumberofnativeprintdriversifandwhenneeded.TheUPSisbuildupoutofaserverandclientcomponents.TheservercomponentgetsinstalledontheprintserverandtheclientcomponentisinstalledontheXenAppserver.AsofFP3forXenDesktop7.6theUniversalPrintServerisnowofficiallysupportedonWindowsServer2012R2aswell.

Page 12: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

12

Insimplytermsthisiswhathappens.Afterauserclicksprintandtheapplicationproducessomeformofprintoutput(EMF/XPS)thiswillbehandedovertothelocalprintsubsystem(UPD)ontheXenAppserver.SincetheUniversalPrintServerdoesnotsupportanyformofclientsiderendering,theprintoutputwouldbeimmediatelysendovertotheCitrixUPClientcomponentfromwhereitisbeforwardedUPServercomponent.Finallytheso-calledWindowsprintsubsystemontheprintserverwillhandle(render,spool)itfromthereon.“Testingwillbenecessarytoguaranteethatcompressionwillactuallytakeplace.

Additionally,whentheUniversalPrintServerisusedyoucanalsoconfigureafeaturenamed‘proximityprinting’,whichisbasedonsession(network)printers.Withproximityprinting,sessionprinterpoliciesarefilteredonIPaddressorsubnet,basedonyourIPaddressorthesubnetthatyouareinspecificprinterscanbeassigned.Thiswayyouwillalwayshavetheprinterthatisclosestmappedwithinyoursession.TheUniversalPrintDriverThisoneiswellknowandhasbeenaroundfroawhilenow.It’sbasicallymeantasaonedrivertorulethemallkindofscenario,butweallknowthatisnexttoimpossible.Itdoesdoagoodenoughjobinmostcasesthough.Oneofthebiggestthingsmissing,andthemainreasonwhyweusecombinedwithothernativedriversisthelackofenhancedprintingcapabilities.Asitstandtodayitonlysupportstaplingandsorting,that’saboutit.ItisavailableinbothEMF(default)aswellasXPSandcomesinstalledaspartoftheVDAinstallation.Allyouneedtodoisenableitsinceitwillbedisabledbydefault.Onceenabledyoumight

Page 13: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

13

wanttohavealookatthe‘Universalprintdriverusageandpreference’policies.Youhaveabunchofoptionstoselectfrom.TheUniversalPrinterWhenauserlogsinandsuccessfullyestablishessessionontheCitrix(XenApp)server,nodefaultprinters,orallprintersknowntotheclient,willbemappedintothesession(defaultbehavior).Insteaditwillcreateageneric,orlogical,printobjectatthebeginningofthesession.Thismeansthatnoprintermappingorenumerationwilltakeplaceatall,whichwillspeeduptheloginprocess.Thislogicalobjectisthenmappedtotheclientsdefaultconfiguredprinter,althoughthiscanbeconfiguredtoanyprinterknowntotheclientdevice.Asasidenote,thiswillonlyworkforWindowsbasedclientsonly.Let’sspeedsthingsupalittleThereareacoupleofwaystospeedup,accelerateorimproveCitrixprinting.Somearereasonablysimpleandobviouswhileothersmightneedsomeadditionalconsiderationandplanning.I’llstartbylistingafewoptions.

1. GivetheICAvirtualprintchannelahigherpriority.2. ICAtraffic(ingeneral)canbeacceleratedbyimplementingaCloudBridgeoran

F5applianceforexample.Andthereareafewmore‘tastes’ofcourse.3. Wecanallocate,limitandcontrolprinttrafficthroughpolicies,whichcanthenbe

appliedperuser,serverorforthewholeSite.4. Wecanconfiguresession(network)printersonfast(er)networks.Hereyou

basicallyspecifyabunchofspecificnetworkprinters(couldbeonlyonejustaseasy)tobemappedwithinasessionandassignthemtousersetc.

5. UsetheUniversalPrintserverforadditionalcompressionandQoSoptions.Ithinkmostspeakforthemselves,sofornowIwouldonlyliketodiscussoptionnumberone,sincethisisaspecialone.Asyoumightknow,theICAprotocolisbuildupoutofmultipleICAvirtualchannels(VC)eachwithadifferentpurpose,whichwecancontrol/manageusingpolicies.Itgoeswithoutsayingthatthereisalsovirtualchannelforprinting.WithintheICAprotocolthereare4differentpriorities,whichcanbeassignedtothesevirtualchannels,rangingfrom0to3.ThehigherthenumberthelessrelevanceisgiventothespecificVC,meaning,inthecaseofapriority3VCitwillbehandledasabackgroundprocess.Theprintingvirtualchannelhasapriorityof3bydefault.Bytheway,thepriority0virtualchannelsarealsoknownasThinwire(thereitisagain).“Isprintingslow?Rememberthatitisn’tjustaboutthebandwidthexclusively.Makesuretocheckforcongestionandlatency.

Page 14: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

14

Sosimplyput,ifyoucanlocatethevirtualprintchannel(inregistry)andgiveitalowernumber(equalsahigherpriority)youbasicallychangeitfromabackgroundservicetoamorecriticalchannel.HKLM\System\CurrentControlSet\Control\TerminalServer\Wds\icawd\Priority.

Althoughtheabovesoundseasy,becareful.Assigningahigherprioritytotheprintvirtualchannelalsomeansthatyouaretakingawayprioritysomewhereelse.Thisneedstobethoughttrough.Keytakeaways1 Therearetwomain(Microsoft)printfileformats,EMFandXPS.2 EMFprintoutputisfirstrenderedbytheGDI-GraphicalDeviceInterface-before

beinghandedovertothespoolerservice.3 XPSwasintroducedasofWindowsVista.EMFdevelopmentendedwithWindows

XPandServer2003.4 EMFdataisnotcompressed.XPSdatadoesgetcompressed.5 WithEMFeachimageneedstoberedrawnoverandoveragain,evenifthesame

imageisusedmultipletimes.XPScanreferenceasingleimagemultipletimes,thinkcompanylogo's,watermarksetc.

6 TobeabletouseXPSbothyourprintdeviceaswellastheprintdriverneedtosupporttheXPSprintfileformat.Ifnot,itwillfallbacktoEMF.

7 HighlevelPrintSpooling:Printoutputisreceivedbythespoolerservice,printdriverrendersMetafileintorawdatareadablebyprintdevice(theactualprint-job),spoolerservicesendsprint-jobtophysicalprintdevice.

8 Whenspooledlocally,localresources(CPU,Memory)areleveraged.Nonetworktrafficgenerated.

9 Whenspooledremotely(printserver)remoteresourcesareleveraged.ThiswillalsoproduceadditionalnetworktrafficbetweentheXenAppandprintserver.Mightbesomethingtoconsiderdependingonyourprintarchitecture.

10 Mostprintissuescanbeleadbacktobadlywrittendrivers.Nottestedand/oroptimizedformultiuserenvironments.

11 Mainproblemsusedtobe(orstillare):Spoolerservicecrashes,CTXprintmanagerservicecrashes,bluescreens,autoprintcreationfailures,highCPUloadsandmore.

12 DoNOTmakeuseofkernelmode(version2)printdrivers.13 Useusermode(version3and4)printdriversexclusively.14 Considerisolatingyourprintdriversa.k.a.PrintDriverIsolationintroducedwith

WindowsServer2008R2.15 But…onlyapplyPrintDriverIsolationwhereitmakessense.16 Therearethreeisolationmodesavailable:None,SharedandIsolated.17 WhentheIsolatedmodeisusedaseparateisolatedrun-space

(PrintIsolationHost)onaperdriverbasiswillbecreated,completelyisolatingthedriverfromallotherdriversonthesamemachine,includingtheprintandspoolerservices.

18 ThesamehappenswiththeSharedmode,aseparateisolatedrun-spacewillbecreatedbutthis'space'willbesharedwithmultiple(selectable)drivers.

19 WhenIsolationmodegetsappliedtomultipledrivers(isolatingeachdriverseparately)itwilldemandmoreresources(CPU,Memory)fromthelocal

Page 15: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

15

machinewhencomparedto'Shared'and'None'.20 Ifaisolateddriverfailsorgetcorrupteditcanonlyaffectitselfortheother

driversaspartofSharedisolationmodelforexample.Allotherdriversonthesamemachinewouldbeunaffectedincludingtheprintandspoolerservices.

21 Useisolatedmodefortestingpurposesonly,usesharedmodeinproduction.22 Version4modesprintdrivers:DesignedforMetrostyleapplications(XPS),

enhancedprintersharing,easiertoinstall,maintain,manageetc.23 WhenaCitrixsessionstarts,theuserlogsin,itwill,bydefault,trytomapall

printersknowntotheclientdevicewithinthatsession.24 Changethisbehaviortomaptheclientsdefaultprinteronly.Configurethe‘Auto-

createclientprinters’policyforthis.Ofcourseyouhavemultipleoptionstochoosefrom.

25 ThesystemwillusetheWindowsversionoftheprinterdriverifitisavailableontheServerOSmachine(itwilltrytomatchthedriverfoundontheclientdevice).Iftheprinterdriverisnotavailable,thesystemattemptstoinstallthedriverfromtheWindowsoperatingsystem.IfthedriverisnotavailableinWindowsitwilltryandusetheCitrixUniversalprintdriver(itwillneedtoenabledforthistowork).

26 Configurethe‘Automaticinstallationofin-boxprinterdrivers;tochangethisbehavior.

27 Thinkaboutimplementing‘printerdrivermappingcompatibility’.Printdrivermappingisusefulinsituationswheretheprintdriverontheclientisnameddifferentlythantheprintdriverontheserver(theseneedtomatch)butdooffertheexactsamefunctionality.Itcanalsobeconfiguredtocreateawhitelist,thiswayyoutellthesystemthatitisoktoautoinstallprintdriverswhennotfoundonthesystem,butonlyifthosedriversareonthelist.

28 Use‘signed’driversexclusivelyandalwaysthoroughlytestyourprintarchitecturesetup,nomatterhowconvincedyoumaybeitwillwork.

29 Limitthenumberofprintdriversinstalled,lessismore!30 Whencomparingprintdrivers(client/server)makesuretolookattheversion

numbersaswell,theyneedtomatcha100%.31 Avoidupgradingprintdrivers.Alwaysuninstalltheolddriverandinstallthenew

one.32 Contacttheprintdrivervendorifandwhenneeded.Forexample,iftheyonly

haveversion2printdrivers,ortheirdriversarenottested/signedformultiuserenvironments.

33 AlwaystrytomatchtheprintserverOStothatoftheXenAppserverOS.34 TheCitrixPrintManagementServicewasintroducedaround2005,whichis

aroundthesametimeastheEMFbasedUPD.35 ItcommunicateswiththespoolerserviceandthelocalICAclient,itcompressed

printdatabeforesendovertheICAchannelanditalsomanagestheICAvirtualchannelforclientprintmapping.

36 Bothservices,printmanagerandspooler,canbeconfiguredtoautomaticallyrestartwhenneeded.

37 Printingpreferences(user)andpropertieswillbestoredontheclientdevicebydefault.IfthisisnotsupportedtheywillbestoredintheuserprofilewithintheserverOperatingSystem.

38 Configurethe‘Printerpropertiesretention’policytochangethisdefaultbehavior.Youhavemultipleoptions.

Page 16: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

16

39 Aprintingpathwaydefineshowprinttrafficcanorwillberoutedthroughoutyourenvironment.Italsotellsuswhereajobgetsprocessed,spooled,renderedetc.

40 TherearetwoCitrixprintingpathways,theclientprinting-pathwayandthenetwork-printingpathway.

41 Besidesthesepathwaysthereisalsoasetupnamed‘Serverlocalprinters’,whichisbasicallyaphysicalprintdevicedirectlyattachedtoaXenAppserver.

42 Withthe‘Serverlocalprinterssetup’spoolingtakesplacelocallyfromaclientperspective.

43 Whenusingtheclientprinting-pathway,applicationprintoutputisspooled/renderedontheXenAppserver(again,localfromaclientperspective)beforeitissendback(leveragingtheICAprotocol)totheclientdevice.Fromtheretheprintjobwillbedeliveredtothephysicalprintdevice.

44 Withtheclientprinting-pathwaythetrafficsendbetweentheXenAppserverandtheclientdeviceissendovertheICAprotocol,meaningitcanbemanaged/compressed.

45 Whena(fat)clientdevicehasalocalprinterprovisionedtheclient-printingpathwaywillalwaysbeused.

46 WhenTCP/IPdirectprintersareaddedmanuallyorbyusing/applyingGroupPolicyPreferences,theprinterisseenandtreatedasalocallyattachedprinter.Assuch,printtrafficwillflowthroughtheclientprinting-pathway.

47 Thinclientdevices(oftenLinuxbased)donotsupporttheclient-printingpathway.Theylacklocalprintingcapabilities.Thenetworkprinting-pathway(sessionprintersforexample)willneedtobeusedinstead.

48 Thenetworkprinting-pathwaywillsendtheapplicationprintoutputfromtheXenAppservertotheprintserverwhereitwillbespooled/rendered.Sospoolingwilltakeplaceremotely.Fromthereitwillsendtheprintjobtothephysicalprintdevice.

49 Usingthenetworkprinting-pathwayalltrafficsendbetweentheXenAppserverandthePrintserverwillbeuncompressed/unmanaged,non-ICA.

50 Whenthesemachinesarephysicallyclosetogether(fastLAN)thiswon’tbeanissue.When,forexample,theprintserverislocatedinthebranchofficeandtheXenAppserverislocatedbackinthedatacenterthiscouldformapotentialproblem.Thinkaboutyoursetup.

51 TheUniversalPrintServercanhelpcompress/managetrafficsendbetweentheXenAppserverandthePrintserver.

52 Whenaclientdevicehasanetworkprovisioned(printserver)printer,Citrixwillalwaystryandrouteprinttrafficoverthenetworkprinting-pathway.

53 Isaytry,becauseiftheprintserverandtheXenAppserverareindifferentdomainsandtheyareunabletocommunicate,theclientprinting-pathwaywillbeusedinstead.Thesameapplieswhenbothmachinesareunabletocommunicateforotherreasons.

54 Bydisablingthe‘Directconnectiontoprintservers’policy,wecanforcetheclientprinting-pathwaytobeused,evenwhennetworkprovisionedprintersareleveraged.

55 Forexample,printserverinthebranchofficeandtheXenAppserverinthedatacenter,clientshavenetwork-provisionedprinters(sonetworkprinting-pathwaywillbeusedbydefault).Byforcingtheclientprinting-pathwayprinttrafficwillbesendback(fromtheXenAppserver)totheclientdeviceleveragingtheICA

Page 17: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

17

protocol,fromtheclientdevicetotheprintserver,overtothephysicalprintdevice.

56 IfboththeXenAppserverandprintserverarelocatedinthedatacenter,thendoNOTapply/forcetheclientprinting-pathway.TrafficwillneedtotraverstheWAN/LANmultipletimes,inanuncompressedformat.

57 Beforeanything,it’simportanttounderstandthedifferencesbetweenbothpathwaysandhowtheycan,andbydefaultwill,beapplied.

58 Thereisnoonesizefitsall,period!59 KeepingtheXenAppandprintserverclosetogetherisn’talwaysthebest

solution.60 AllthisappliestoXenAppaswellasXenDesktopandisn’tIMAofFMAspecific.61 TheUniversalPrintDriver(UPD)isdisabledbydefault.62 TheUPDisinstalledaspartoftheVDA.63 ThereisanEMFaswellasanXPSprintfileformatUPD.64 EMFwasfirst.Itgotintroducedaround2005.65 TheEMFUPDwillbeusedbydefault.Thiscanbechangedthroughpolicy.66 BoththeUniversalPrintServeraswellastheUniversalPrinterusetheUniversal

PrintDriverbydefault.67 IdeallyyouwouldliketousetheUPDexclusively.Remember,lessismore!68 Itcanbeusedcombinedwithnativeprintdrivers.Inmostcasesthisisnecessary

sincetheUPDonlysupportsstaplingandsortingasfarasenhancedprintingfeaturesgo.

69 ConfigurethesystemtousetheUPDwhennonativeprintdriverisavailable.70 TheUniversalPrinterisalogical/genericobjectcreatedatthebeginningofa

session.Itwillbemappedtotheclientsdefaultprinterbutthiscanbechangedtoanyprinterknowntotheclientdevice.

71 WhenusingtheUniversalPrinternoprintmapping/enumerationtakesplace,speedingupthelogon/loginprocess.

72 TheUniversalPrinteronlyworksforWindowsdevices.73 Itispotentiallyusefulwhenthe‘Waitforprintertobecreated’policyisusedor

whenyouneedaccesstomultipleprinters,local&network.74 TheUniversalPrintServer(UPS)consistsoutofaclient(UPClient)andserver

(UPServer)component.75 Makesuretocheckthee-docspagestoseewhichprotocolsareusedandwhich

accompanyingnetworkportsneedtobeopened.76 UsestheUPDbydefaultbutcanbepairedwithWindowsNativeprintdrivers,

again,formoreenhancedprintingcapabilities.77 It’soptimizedfornetworkprintersandofferssomeadditionalcompressionand

QoSoptions.78 ItsupportsbothEMFandXPSbasedprintdrivers.79 Italsoworksforthinclientdevicesandtablets,basedonnetwork(session)

printers.80 TheUPSdoesnotsupportclientsiderendering/spooling.Meaningthatall

applicationprintoutputwillbesendovertotheprintserver(whichhastheUPServercomponentinstalled)rightaway,whichwilltakeoverfromthere.

81 AlltrafficsendbetweentheXenApp(UPClientcomponent)andprintserver(UPServercomponent)canbemanaged/compressedwhenenablingtheUPS.

82 Wheninstalleditwillbedisabledbydefault.Needstobeenabledbyconfiguringthe‘UniversalPrintServerenable’policy.

Page 18: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

18

83 NetworkprinterwillleveragetheUPSautomaticallythroughaprocesscalledauto-discovery.

84 AsofXenDesktopTechPreview3(TP3)theUniversalPrintServerisfullysupportedonWindowsServer2012(R2)aswellasServer2008R2.

85 Itcanhandleupto50printjobsperminute,max.86 Recommendedforremoteofficescenarios.Pleasenotethattestingwillbe

necessarytoseeifeducatecompressionratiosareachieved.87 Helpsinmanagingalargeamountofnetworkprinters.88 Canbeusedforproximityprinting.TheUPSisaprerequisite.89 TheICAprotocolisbuildupoutofmultiple(32)virtualchannels.Eachvirtual

channelhasit’sownpurpose.Thereisalsoaprintingvirtualchannel.90 ICAchannelshavedifferentpriorities,rangingfrom0to3,with0beingthe

highest/mostimportant.91 Theprio0virtualchannelsarealsoreferredtoasThinwire(soundfamiliar)?92 Theprintingvirtualchannel,bydefault,hasapriorityof3,thelowest.It’streated

asabackgroundprocess.93 Virtualchannelprioritiescanbechangedbyeditingtheaccompanyingregistry

keyandchangingthevaluenumber.94 Thinkthisthrough.Whengivingmore,orahigherprioritytoaspecificVCitalso

meansthatyouaretakingawayprioritysomewhereelse.95 HKLM\System\CurrentControlSet\Control\TerminalServer\Wds\icawd\Priority

istheregistrykeythatgoeswiththeprintingVC.96 WecanaccelerateICAtrafficingeneral,includingprinttraffic,byimplementinga

CitrixCloudbrigdeforexample.97 Allocate/configureprintingbandwidththroughCitrixpoliciesandapplythem

onaperuser,perserverorperSitebasis.98 Usesession(network)printersonfast(er)networks.99 Sessionprintersarenetworkprintersthatcanbeassignedandmappedtoa

specificuserorusergroups.100 WithproximityprintingsessionarefilteredbasedonIPaddressesorsubnets

(therearesomemoreoptions).Thiswayauserwillalwaysconnecttotheclosestprinter(UPSisneeded).

101 Whendealingwithslowprintingrememberthatit’snotallaboutnetworkbandwidth.Alsocheckforcongestionandlatency.

102 The‘simpler’theprintdriverthelesstrafficwillbegenerated.Usevendordriversonlywhenspecificfunctionalityisneeded.

103 Lastminuteeditionfromthee-docspages:XenAppandXenDesktop7.6FP3includesanAlways-OnloggingfeaturefortheprintserverandprintingsubsystemontheVDA.InordertocollatethelogsasaZIPforemailing,ortoautomaticallyuploadtoCitrixInsightsServices,usethePowerShellcmdlet(Start-TelemetryUpload)suppliedwiththeVDAinstallerin7.6FP3.

104 Lastupdated:15May2015.CitrixPrintingTool3.1helpsconfiguringandtroubleshootingtheCitrixPrintingsubsystemonXenApp,XenAppOnlinePlugin,andXenDesktop.

105 Lastupdated:15May2015.PrintDetectiveisaninformationgatheringutilitythatcanbeusedfortroubleshootingproblemsrelatedtoprintdrivers.ItenumeratesallprinterdriversfromthespecifiedWindowsmachine,includingdriverspecificinformation.Itcanalsobeusedtodeletespecifiedprintdrivers.Itallowsforlogfilecapabilitiesandprovidesacommand-lineinterfaceaswell.

Page 19: The Ultimate Citrix printing internals cheat sheet! · Part two will also include a list of all Citrix best practices and recommendations’ including some tips and tricks from the

19

106 Lastupdated:13November2015:Allpurposetroubleshoottool-RunCitrixScoutfromasingleXenDesktopcontroller(DDC)orXenAppservertocapturekeydatapointsandCDFtracesforselectedcomputersfollowedbysecureandreliableuploadofthedatapackagetoCitrixTechnicalSupport.

107 Lastupdated:31August2015.TheCitrixUPSPrintDriverCertificationToolcanbeusedtotestthecompatibilityofaprintdriverwiththeCitrixUniversalPrintServer.

108 Lastupdated:15May2015.Notsure?TestyourprintdriversthoroughlyusingStressPrinters.

109 CheckoutMicrosoft’s(MSDN)webpagetofindoutmoreaboutPrintDriverIsolation.

110 Releasedata:February2012,primarilyfocusedonXenApp6.5:XenAppPrinterDriverManager.ManageyourXenAppprintdrivers.UpdatetheAutomaticPrinterReplicationListwithaGUI.Haveaoverviewofwhatdriversareinstalledonwhatservers.

111 AcollectionofCitrixtroubleshootanddiagnostictools.CtxAdmTools.Ihopeyoufoundthissomewhatinformative.Thanksforreading,downloadingandhopefullysharing!


Recommended