[{"data":1,"prerenderedAt":1802},["ShallowReactive",2],{"blog-current-shopware-5-parallel-thumbnail-generation-en":3,"blog-previous-shopware-5-parallel-thumbnail-generation-en":570,"blog-next-shopware-5-parallel-thumbnail-generation-en":584,"blog-alt-de-shopware-5-parallel-thumbnail-generation-en":596,"blog-alt-en-shopware-5-parallel-thumbnail-generation-en":598,"employee-bernd-helm":599,"content-query-Fqgo9f8ijK":706,"content-query-t20WiKE4uI":1179,"content-query-1PFeYVQSzn":1738,"related-refs-shopware--en":1774},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"author":10,"image":11,"releaseDate":12,"blogCategories":13,"articleTags":16,"tags":18,"body":20,"_type":564,"_id":565,"_source":566,"_file":567,"_stem":568,"_extension":569},"/en/blog/shopware-5-parallel-thumbnail-generation","blog",false,"","Shopware 5 – High-Speed Parallel Thumbnail Generation","How to tune the integrated SW5 mechanism to work more then 22 times faster! Shopware 5 - parallel thumbnail generation after moving a Shopware 5 system to another server. We had a customer with 400k images and 1600k thumbnails that needed to move from an old HDD based server to a new SSD …","bernd-helm","/images/shopware.svg","2021-04-29",[14,15],"Shopware","DevOps",[17],"VPN",[19],"shopware",{"type":21,"children":22,"toc":559},"root",[23,32,38,50,55,61,66,86,95,100,105,455,460,465,470,475,487,539,547,553],{"type":24,"tag":25,"props":26,"children":28},"element","h2",{"id":27},"shopware-5-parallel-thumbnail-generation-after-moving-a-shopware-5-system-to-another-server",[29],{"type":30,"value":31},"text","Shopware 5 - parallel thumbnail generation after moving a Shopware 5 system to another server",{"type":24,"tag":33,"props":34,"children":35},"p",{},[36],{"type":30,"value":37},"We had a customer with 400k images and 1600k thumbnails that needed to move from an old hdd based server to a new ssd based one. The problem was that the old server was so slow that it already needed two days to count through all images, not speaking about coping them.",{"type":24,"tag":33,"props":39,"children":40},{},[41,43],{"type":30,"value":42},"So we decided to copy only the original images and regenerate the Thumbnails. For copying the original images, I created a small console command that exports all paths of the original images that we need to copy: ",{"type":24,"tag":44,"props":45,"children":47},"a",{"href":46},"https://gist.github.com/bhelm/2d30f0cebcf4a7d8ea41c532ec67cd62",[48],{"type":30,"value":49},"ExportImagesCommand.php",{"type":24,"tag":33,"props":51,"children":52},{},[53],{"type":30,"value":54},"This filelist can be used with tar -T or rsync --files-from= options that tells these tools to only process the listed files. for the initial copy process, tar is highly recommended, as it just picks up the files listed without doing any \"calculation\" as rsync does.",{"type":24,"tag":25,"props":56,"children":58},{"id":57},"sw5-default-thumbnail-generation-would-have-taken-80-hours",[59],{"type":30,"value":60},"SW5 default thumbnail generation would have taken 80 hours",{"type":24,"tag":33,"props":62,"children":63},{},[64],{"type":30,"value":65},"... and would only use half of a core.",{"type":24,"tag":33,"props":67,"children":68},{},[69,71,77,79,84],{"type":30,"value":70},"I was curious if I can speed up this generation process. The server itself has 32 cores available, so I copied the ",{"type":24,"tag":72,"props":73,"children":74},"em",{},[75],{"type":30,"value":76},"generate thumbnail",{"type":30,"value":78}," command from sw5 and modified it to work in batches with an ",{"type":24,"tag":72,"props":80,"children":81},{},[82],{"type":30,"value":83},"--batch",{"type":30,"value":85}," parameter:",{"type":24,"tag":33,"props":87,"children":88},{},[89],{"type":24,"tag":44,"props":90,"children":92},{"href":91},"https://gist.github.com/bhelm/2015d3829d4a3f24f9760f6e4e1aac1f",[93],{"type":30,"value":94},"ParallelThumbnailGenerateCommand.php",{"type":24,"tag":33,"props":96,"children":97},{},[98],{"type":30,"value":99},"To make it work, I just modified the Shopware core at engine/Shopware/Models/Media/Repository.php",{"type":24,"tag":33,"props":101,"children":102},{},[103],{"type":30,"value":104},"I just changed the getAlbumMediaQuery function to:",{"type":24,"tag":106,"props":107,"children":111},"pre",{"className":108,"code":109,"language":110,"meta":7,"style":7},"language-cpp shiki shiki-themes github-dark github-dark monokai","public function getAlbumMediaQuery($albumId, $filter = null, $orderBy = null, $offset = null, $limit = null, $validTypes = null, $batch = null)\n{\n$builder = $this->getAlbumMediaQueryBuilder($albumId, $filter, $orderBy, $validTypes);\nif (is_numeric($batch)) {\n$builder->andWhere('MOD(media.id, 1000) = ?3');\n$builder->setParameter(3, $batch);\n}\n\n    if ($limit !== null) {\n        $builder->setFirstResult($offset)\n                ->setMaxResults($limit);\n    }\n\n    return $builder->getQuery();\n}\n","cpp",[112],{"type":24,"tag":113,"props":114,"children":115},"code",{"__ignoreMap":7},[116,195,204,243,267,297,325,334,344,368,387,406,415,423,447],{"type":24,"tag":117,"props":118,"children":121},"span",{"class":119,"line":120},"line",1,[122,128,134,139,145,150,154,159,163,168,172,177,181,186,190],{"type":24,"tag":117,"props":123,"children":125},{"style":124},"--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2",[126],{"type":30,"value":127},"public function ",{"type":24,"tag":117,"props":129,"children":131},{"style":130},"--shiki-default:#B392F0;--shiki-dark:#B392F0;--shiki-sepia:#A6E22E",[132],{"type":30,"value":133},"getAlbumMediaQuery",{"type":24,"tag":117,"props":135,"children":136},{"style":124},[137],{"type":30,"value":138},"($albumId, $filter ",{"type":24,"tag":117,"props":140,"children":142},{"style":141},"--shiki-default:#F97583;--shiki-dark:#F97583;--shiki-sepia:#F92672",[143],{"type":30,"value":144},"=",{"type":24,"tag":117,"props":146,"children":147},{"style":124},[148],{"type":30,"value":149}," null, $orderBy ",{"type":24,"tag":117,"props":151,"children":152},{"style":141},[153],{"type":30,"value":144},{"type":24,"tag":117,"props":155,"children":156},{"style":124},[157],{"type":30,"value":158}," null, $offset ",{"type":24,"tag":117,"props":160,"children":161},{"style":141},[162],{"type":30,"value":144},{"type":24,"tag":117,"props":164,"children":165},{"style":124},[166],{"type":30,"value":167}," null, $limit ",{"type":24,"tag":117,"props":169,"children":170},{"style":141},[171],{"type":30,"value":144},{"type":24,"tag":117,"props":173,"children":174},{"style":124},[175],{"type":30,"value":176}," null, $validTypes ",{"type":24,"tag":117,"props":178,"children":179},{"style":141},[180],{"type":30,"value":144},{"type":24,"tag":117,"props":182,"children":183},{"style":124},[184],{"type":30,"value":185}," null, $batch ",{"type":24,"tag":117,"props":187,"children":188},{"style":141},[189],{"type":30,"value":144},{"type":24,"tag":117,"props":191,"children":192},{"style":124},[193],{"type":30,"value":194}," null)\n",{"type":24,"tag":117,"props":196,"children":198},{"class":119,"line":197},2,[199],{"type":24,"tag":117,"props":200,"children":201},{"style":124},[202],{"type":30,"value":203},"{\n",{"type":24,"tag":117,"props":205,"children":207},{"class":119,"line":206},3,[208,213,217,222,228,233,238],{"type":24,"tag":117,"props":209,"children":210},{"style":124},[211],{"type":30,"value":212},"$builder ",{"type":24,"tag":117,"props":214,"children":215},{"style":141},[216],{"type":30,"value":144},{"type":24,"tag":117,"props":218,"children":219},{"style":124},[220],{"type":30,"value":221}," $",{"type":24,"tag":117,"props":223,"children":225},{"style":224},"--shiki-default:#79B8FF;--shiki-dark:#79B8FF;--shiki-sepia:#FD971F",[226],{"type":30,"value":227},"this",{"type":24,"tag":117,"props":229,"children":230},{"style":124},[231],{"type":30,"value":232},"->",{"type":24,"tag":117,"props":234,"children":235},{"style":130},[236],{"type":30,"value":237},"getAlbumMediaQueryBuilder",{"type":24,"tag":117,"props":239,"children":240},{"style":124},[241],{"type":30,"value":242},"($albumId, $filter, $orderBy, $validTypes);\n",{"type":24,"tag":117,"props":244,"children":246},{"class":119,"line":245},4,[247,252,257,262],{"type":24,"tag":117,"props":248,"children":249},{"style":141},[250],{"type":30,"value":251},"if",{"type":24,"tag":117,"props":253,"children":254},{"style":124},[255],{"type":30,"value":256}," (",{"type":24,"tag":117,"props":258,"children":259},{"style":130},[260],{"type":30,"value":261},"is_numeric",{"type":24,"tag":117,"props":263,"children":264},{"style":124},[265],{"type":30,"value":266},"($batch)) {\n",{"type":24,"tag":117,"props":268,"children":270},{"class":119,"line":269},5,[271,276,281,286,292],{"type":24,"tag":117,"props":272,"children":273},{"style":124},[274],{"type":30,"value":275},"$builder->",{"type":24,"tag":117,"props":277,"children":278},{"style":130},[279],{"type":30,"value":280},"andWhere",{"type":24,"tag":117,"props":282,"children":283},{"style":124},[284],{"type":30,"value":285},"(",{"type":24,"tag":117,"props":287,"children":289},{"style":288},"--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF;--shiki-sepia:#E6DB74",[290],{"type":30,"value":291},"'MOD(media.id, 1000) = ?3'",{"type":24,"tag":117,"props":293,"children":294},{"style":124},[295],{"type":30,"value":296},");\n",{"type":24,"tag":117,"props":298,"children":300},{"class":119,"line":299},6,[301,305,310,314,320],{"type":24,"tag":117,"props":302,"children":303},{"style":124},[304],{"type":30,"value":275},{"type":24,"tag":117,"props":306,"children":307},{"style":130},[308],{"type":30,"value":309},"setParameter",{"type":24,"tag":117,"props":311,"children":312},{"style":124},[313],{"type":30,"value":285},{"type":24,"tag":117,"props":315,"children":317},{"style":316},"--shiki-default:#79B8FF;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF",[318],{"type":30,"value":319},"3",{"type":24,"tag":117,"props":321,"children":322},{"style":124},[323],{"type":30,"value":324},", $batch);\n",{"type":24,"tag":117,"props":326,"children":328},{"class":119,"line":327},7,[329],{"type":24,"tag":117,"props":330,"children":331},{"style":124},[332],{"type":30,"value":333},"}\n",{"type":24,"tag":117,"props":335,"children":337},{"class":119,"line":336},8,[338],{"type":24,"tag":117,"props":339,"children":341},{"emptyLinePlaceholder":340},true,[342],{"type":30,"value":343},"\n",{"type":24,"tag":117,"props":345,"children":347},{"class":119,"line":346},9,[348,353,358,363],{"type":24,"tag":117,"props":349,"children":350},{"style":141},[351],{"type":30,"value":352},"    if",{"type":24,"tag":117,"props":354,"children":355},{"style":124},[356],{"type":30,"value":357}," ($limit ",{"type":24,"tag":117,"props":359,"children":360},{"style":141},[361],{"type":30,"value":362},"!==",{"type":24,"tag":117,"props":364,"children":365},{"style":124},[366],{"type":30,"value":367}," null) {\n",{"type":24,"tag":117,"props":369,"children":371},{"class":119,"line":370},10,[372,377,382],{"type":24,"tag":117,"props":373,"children":374},{"style":124},[375],{"type":30,"value":376},"        $builder->",{"type":24,"tag":117,"props":378,"children":379},{"style":130},[380],{"type":30,"value":381},"setFirstResult",{"type":24,"tag":117,"props":383,"children":384},{"style":124},[385],{"type":30,"value":386},"($offset)\n",{"type":24,"tag":117,"props":388,"children":390},{"class":119,"line":389},11,[391,396,401],{"type":24,"tag":117,"props":392,"children":393},{"style":141},[394],{"type":30,"value":395},"                ->",{"type":24,"tag":117,"props":397,"children":398},{"style":130},[399],{"type":30,"value":400},"setMaxResults",{"type":24,"tag":117,"props":402,"children":403},{"style":124},[404],{"type":30,"value":405},"($limit);\n",{"type":24,"tag":117,"props":407,"children":409},{"class":119,"line":408},12,[410],{"type":24,"tag":117,"props":411,"children":412},{"style":124},[413],{"type":30,"value":414},"    }\n",{"type":24,"tag":117,"props":416,"children":418},{"class":119,"line":417},13,[419],{"type":24,"tag":117,"props":420,"children":421},{"emptyLinePlaceholder":340},[422],{"type":30,"value":343},{"type":24,"tag":117,"props":424,"children":426},{"class":119,"line":425},14,[427,432,437,442],{"type":24,"tag":117,"props":428,"children":429},{"style":141},[430],{"type":30,"value":431},"    return",{"type":24,"tag":117,"props":433,"children":434},{"style":124},[435],{"type":30,"value":436}," $builder->",{"type":24,"tag":117,"props":438,"children":439},{"style":130},[440],{"type":30,"value":441},"getQuery",{"type":24,"tag":117,"props":443,"children":444},{"style":124},[445],{"type":30,"value":446},"();\n",{"type":24,"tag":117,"props":448,"children":450},{"class":119,"line":449},15,[451],{"type":24,"tag":117,"props":452,"children":453},{"style":124},[454],{"type":30,"value":333},{"type":24,"tag":33,"props":456,"children":457},{},[458],{"type":30,"value":459},"It is an optional parameter and won’t break anything. If you do a Shopware update, this would be gone, but as I was in the quest to speed up things for a one-time task, I just modified it in the core instead of finding a long-term solution.",{"type":24,"tag":33,"props":461,"children":462},{},[463],{"type":30,"value":464},"What this function does is calculating a modulo of 1000 on the media id and compares it with the batch id. So we basically have 1000 batches to process until all work is done.",{"type":24,"tag":33,"props":466,"children":467},{},[468],{"type":30,"value":469},"Now we only need to start all 1000 batches in a parallel manner. For doing so, I used the very helpful tool parallel - which is available in Linux:",{"type":24,"tag":33,"props":471,"children":472},{},[473],{"type":30,"value":474},"It starts 64 batches in parallel and continues its work until all 1000 batches are finished.",{"type":24,"tag":33,"props":476,"children":477},{},[478,480,485],{"type":30,"value":479},"And this is how it looks at ",{"type":24,"tag":72,"props":481,"children":482},{},[483],{"type":30,"value":484},"htop",{"type":30,"value":486},":",{"type":24,"tag":106,"props":488,"children":492},{"className":489,"code":490,"language":491,"meta":7,"style":7},"language-bash shiki shiki-themes github-dark github-dark monokai","parallel -j 64 ./bin/console my:image:generate:thumbnails --batch ::: {0..999}\n","bash",[493],{"type":24,"tag":113,"props":494,"children":495},{"__ignoreMap":7},[496],{"type":24,"tag":117,"props":497,"children":498},{"class":119,"line":120},[499,504,509,514,519,524,529,534],{"type":24,"tag":117,"props":500,"children":501},{"style":130},[502],{"type":30,"value":503},"parallel",{"type":24,"tag":117,"props":505,"children":506},{"style":316},[507],{"type":30,"value":508}," -j",{"type":24,"tag":117,"props":510,"children":511},{"style":316},[512],{"type":30,"value":513}," 64",{"type":24,"tag":117,"props":515,"children":516},{"style":288},[517],{"type":30,"value":518}," ./bin/console",{"type":24,"tag":117,"props":520,"children":521},{"style":288},[522],{"type":30,"value":523}," my:image:generate:thumbnails",{"type":24,"tag":117,"props":525,"children":526},{"style":316},[527],{"type":30,"value":528}," --batch",{"type":24,"tag":117,"props":530,"children":531},{"style":288},[532],{"type":30,"value":533}," :::",{"type":24,"tag":117,"props":535,"children":536},{"style":288},[537],{"type":30,"value":538}," {0..999}\n",{"type":24,"tag":540,"props":541,"children":546},"img",{"alt":484,"aspect-ratio":542,"height":543,"object-fit":544,"src":545},"2",300,"contain","/blog/htop.png",[],{"type":24,"tag":25,"props":548,"children":550},{"id":549},"finally-all-the-work-is-now-finished-in-35-hours-instead-of-80",[551],{"type":30,"value":552},"Finally, all the work is now finished in 3.5 hours instead of 80.",{"type":24,"tag":554,"props":555,"children":556},"style",{},[557],{"type":30,"value":558},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}",{"title":7,"searchDepth":197,"depth":197,"links":560},[561,562,563],{"id":27,"depth":197,"text":31},{"id":57,"depth":197,"text":60},{"id":549,"depth":197,"text":552},"markdown","common:en:blog:9.shopware-5-parallel-thumbnail-generation.md","common","en/blog/9.shopware-5-parallel-thumbnail-generation.md","en/blog/9.shopware-5-parallel-thumbnail-generation","md",{"_path":571,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":572,"description":573,"author":10,"image":574,"releaseDate":575,"blogCategories":576,"tags":579,"_type":564,"_id":581,"_source":566,"_file":582,"_stem":583,"_extension":569},"/en/blog/btrfs-finding-and-fixing-highly-fragmented-files","BTRFS: Finding and fixing highly fragmented files","Most of the best BTRFS features are powered by the copy-on-write technology. If an application wants to rewrite a part of a file, like the first MB, the Data is not written in-place but in an so-called extend. This enables BTRFS to keep multiple versions of partially rewritten files with only claiming ...","/blog/thumbnails/BTRFS_white.png","2020-10-21",[577,578],"What moves us","Infrastructure",[580],"devops","common:en:blog:8.btrfs-finding-and-fixing-highly-fragmented-files.md","en/blog/8.btrfs-finding-and-fixing-highly-fragmented-files.md","en/blog/8.btrfs-finding-and-fixing-highly-fragmented-files",{"_path":585,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":586,"description":587,"author":10,"image":588,"releaseDate":589,"blogCategories":590,"articleTags":591,"tags":592,"_type":564,"_id":593,"_source":566,"_file":594,"_stem":595,"_extension":569},"/en/blog/how-to-use-different-dns-servers-on-specific-domains","How to use different DNS servers for specific domains name resolution – VPN Use-Case","How to resolve selected domains over VPN on linux. In today's world, more people than ever use VPN services to work from remote. However, in some cases it's not desirable to route all traffic and all domain name resolutions over the VPN connection.","/blog/thumbnails/VPN.png","2022-04-21",[577,15],[17],[580],"common:en:blog:10.how-to-use-different-dns-servers-on-specific-domains.md","en/blog/10.how-to-use-different-dns-servers-on-specific-domains.md","en/blog/10.how-to-use-different-dns-servers-on-specific-domains",{"_path":597},"/blog/shopware-5-parallele-miniaturbildererstellung",{"_path":4},{"_path":600,"_dir":601,"_draft":6,"_partial":6,"_locale":7,"slug":10,"teams":602,"primaryTeam":604,"firstName":605,"lastName":606,"prefixTitle":7,"suffixTitle":7,"education":607,"executiveRole":612,"role":613,"workingSince":621,"inTheCompanySince":622,"techSkills":623,"skills":669,"projects":682,"contactDetails":695,"_image":699,"image":700,"_id":701,"_type":702,"title":703,"_source":601,"_file":704,"_stem":705,"_extension":702},"/employees/bernd-helm","employees",[603,604],"ai","devOps","Bernd","Helm",[608],[609,610,611],"B. Sc. Angewandte Informatik","FHDW Dresden","2010","CTO",[614,615,604,616,617,618,619,620],"founder","chiefTechnologyOfficer","databaseSpecialist","admin","softwareDeveloper","backendDeveloper","consultant","2005","2008",[624,628,631,633,636,638,641,643,645,647,650,654,657,660,663,666],{"name":625,"level":626,"icon":627},"Docker","expert","/images/Docker.svg",{"name":629,"level":626,"icon":630},"Linux","/images/linux_os-mono.svg",{"name":632,"level":626},"Zabbix",{"name":634,"level":626,"icon":635},"MariaDB ColumnStore","/images/maria-db-logo.svg",{"name":637,"level":626},"OpenAI",{"name":639,"level":626,"icon":640},"Pytorch","/images/PyTorch.svg",{"name":642,"level":626},"PHP",{"name":644,"level":626},"Java",{"name":646,"level":626},"Python",{"name":648,"level":626,"icon":649},"SQL","/images/SQL.svg",{"name":651,"level":652,"icon":653},"C++","advanced","/images/cpp-logo.svg",{"name":655,"level":652,"icon":656},"C#","/images/csharp.svg",{"name":658,"level":652,"icon":659},"CSS","/images/css.svg",{"name":661,"level":652,"icon":662},"HTML","/images/html.svg",{"name":664,"level":652,"icon":665},"OpenCV","/images/OpenCV.svg",{"name":667,"level":652,"icon":668},"Vue.js","/images/vuejs.svg",[670,672,674,676,678,680],{"name":671,"level":626},"artificialIntelligence",{"name":673,"level":626},"codingGuidelines",{"name":675,"level":626},"databases",{"name":677,"level":626},"linuxServerAdministration",{"name":679,"level":626},"softwareArchitect",{"name":681,"level":652},"qualityAssurance",[683,686,688,690,693],{"project":684,"position":685},"Gridside","Technical Consultant",{"project":687,"position":685},"Herole",{"project":689,"position":685},"Montagespezis",{"project":691,"position":692},"Orsee","Technical Manager",{"project":694,"position":685},"Vipr",{"eMail":696,"phone":697,"visibility":698},"bernd.helm@helmundwalter.de","+49 351 799 035 20","1","images/employees/Portraits/bernd_helm.webp","images/employees/Portraits/BerndHelm_MS.webp","employees:employees:1.bernd-helm.json","json","Bernd Helm","employees/1.bernd-helm.json","employees/1.bernd-helm",{"_path":571,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":572,"description":573,"author":10,"image":574,"releaseDate":575,"blogCategories":707,"tags":708,"body":709,"_type":564,"_id":581,"_source":566,"_file":582,"_stem":583,"_extension":569},[577,578],[580],{"type":21,"children":710,"toc":1169},[711,717,729,735,740,746,751,792,798,803,809,821,939,957,963,1119,1124,1130,1159,1165],{"type":24,"tag":25,"props":712,"children":714},{"id":713},"what-is-btrfs-fragmentation",[715],{"type":30,"value":716},"What is BTRFS fragmentation?",{"type":24,"tag":33,"props":718,"children":719},{},[720,722,727],{"type":30,"value":721},"Most of the best BTRFS features are powered by the ",{"type":24,"tag":72,"props":723,"children":724},{},[725],{"type":30,"value":726},"copy-on-write technology",{"type":30,"value":728},". If a application wants to rewrite a part of a file, like the first megabyte, the data is not written in-place but in an so-called extend. This enables BTRFS to keep multiple versions of partially rewritten files with only claiming disk space assigned to the changes and not multiple full copies of a file. The old data can be discarded at some point (i.e. if its not used by any snapshots anymore) and the extend will serve the files current version.",{"type":24,"tag":25,"props":730,"children":732},{"id":731},"btrfs-fragmentation-can-hurt-the-performance-of-your-system",[733],{"type":30,"value":734},"BTRFS fragmentation can hurt the performance of your System",{"type":24,"tag":33,"props":736,"children":737},{},[738],{"type":30,"value":739},"You can guess, reading a file with 100k+ extends and adding more extends requires a lot of bookkeeping and storage seeks from your system. That 10GB file there is internally shattered into 100k parts that need to be collected if you want to read the whole file. This clearly adds complexity - and decreases performance.",{"type":24,"tag":25,"props":741,"children":743},{"id":742},"btrfs-fragmentation-can-block-huge-amounts-of-disk-space",[744],{"type":30,"value":745},"BTRFS fragmentation can block huge amounts of disk space",{"type":24,"tag":33,"props":747,"children":748},{},[749],{"type":30,"value":750},"Yes, BTRFS has to store the locations of these 100k extends somewhere, easily adding some extra GB of used disk space to your system. The bad thing is that BTRFS does not tell you that",{"type":24,"tag":33,"props":752,"children":753},{},[754,756,762,764,769,771,776,778,783,785,790],{"type":30,"value":755},"If you see your btrfs filesystem using ",{"type":24,"tag":757,"props":758,"children":759},"strong",{},[760],{"type":30,"value":761},"80GB",{"type":30,"value":763}," in ",{"type":24,"tag":72,"props":765,"children":766},{},[767],{"type":30,"value":768},"df",{"type":30,"value":770}," and ",{"type":24,"tag":72,"props":772,"children":773},{},[774],{"type":30,"value":775},"btrfs fi show",{"type":30,"value":777}," while ",{"type":24,"tag":72,"props":779,"children":780},{},[781],{"type":30,"value":782},"du -hsx",{"type":30,"value":784}," only shows ",{"type":24,"tag":757,"props":786,"children":787},{},[788],{"type":30,"value":789},"54GB",{"type":30,"value":791}," there are only two reasons i am aware of to cause this: either you have snapshots that keep old extends - or you have massive fragmentation.",{"type":24,"tag":25,"props":793,"children":795},{"id":794},"btrfs-filesystem-defrag",[796],{"type":30,"value":797},"BTRFS filesystem defrag",{"type":24,"tag":33,"props":799,"children":800},{},[801],{"type":30,"value":802},"It is possible to use BTRFS filesystem defrag on your whole file system, but that causes all you snapshots to duplicate the data. it also causes a lot of IO so this is nothing you want to do on your production server without a reason. There is really no point in defrag'ing static files that are almost never changed.",{"type":24,"tag":25,"props":804,"children":806},{"id":805},"find-the-most-fragmented-files-on-your-system",[807],{"type":30,"value":808},"Find the most fragmented files on your System",{"type":24,"tag":33,"props":810,"children":811},{},[812,814,819],{"type":30,"value":813},"There is a linux-tool called ",{"type":24,"tag":72,"props":815,"children":816},{},[817],{"type":30,"value":818},"filefrag",{"type":30,"value":820}," which reports how many fragments a file consists of. So i thought ... „why not try to find the most fragmented files and fix just these?“ here you go:",{"type":24,"tag":106,"props":822,"children":824},{"className":489,"code":823,"language":491,"meta":7,"style":7},"find / -xdev -type f| xargs filefrag 2>/dev/null | sed 's/^\\(.*\\): \\([0-9]\\+\\) extent.*/\\2 \\1/' | awk -F ' ' '$1 > 500' | sort -n -r\n",[825],{"type":24,"tag":113,"props":826,"children":827},{"__ignoreMap":7},[828],{"type":24,"tag":117,"props":829,"children":830},{"class":119,"line":120},[831,836,841,846,851,856,861,866,871,876,881,886,891,896,900,905,910,915,920,924,929,934],{"type":24,"tag":117,"props":832,"children":833},{"style":130},[834],{"type":30,"value":835},"find",{"type":24,"tag":117,"props":837,"children":838},{"style":288},[839],{"type":30,"value":840}," /",{"type":24,"tag":117,"props":842,"children":843},{"style":316},[844],{"type":30,"value":845}," -xdev",{"type":24,"tag":117,"props":847,"children":848},{"style":316},[849],{"type":30,"value":850}," -type",{"type":24,"tag":117,"props":852,"children":853},{"style":288},[854],{"type":30,"value":855}," f",{"type":24,"tag":117,"props":857,"children":858},{"style":141},[859],{"type":30,"value":860},"|",{"type":24,"tag":117,"props":862,"children":863},{"style":130},[864],{"type":30,"value":865}," xargs",{"type":24,"tag":117,"props":867,"children":868},{"style":288},[869],{"type":30,"value":870}," filefrag",{"type":24,"tag":117,"props":872,"children":873},{"style":141},[874],{"type":30,"value":875}," 2>",{"type":24,"tag":117,"props":877,"children":878},{"style":288},[879],{"type":30,"value":880},"/dev/null",{"type":24,"tag":117,"props":882,"children":883},{"style":141},[884],{"type":30,"value":885}," |",{"type":24,"tag":117,"props":887,"children":888},{"style":130},[889],{"type":30,"value":890}," sed",{"type":24,"tag":117,"props":892,"children":893},{"style":288},[894],{"type":30,"value":895}," 's/^\\(.*\\): \\([0-9]\\+\\) extent.*/\\2 \\1/'",{"type":24,"tag":117,"props":897,"children":898},{"style":141},[899],{"type":30,"value":885},{"type":24,"tag":117,"props":901,"children":902},{"style":130},[903],{"type":30,"value":904}," awk",{"type":24,"tag":117,"props":906,"children":907},{"style":316},[908],{"type":30,"value":909}," -F",{"type":24,"tag":117,"props":911,"children":912},{"style":288},[913],{"type":30,"value":914}," ' '",{"type":24,"tag":117,"props":916,"children":917},{"style":288},[918],{"type":30,"value":919}," '$1 > 500'",{"type":24,"tag":117,"props":921,"children":922},{"style":141},[923],{"type":30,"value":885},{"type":24,"tag":117,"props":925,"children":926},{"style":130},[927],{"type":30,"value":928}," sort",{"type":24,"tag":117,"props":930,"children":931},{"style":316},[932],{"type":30,"value":933}," -n",{"type":24,"tag":117,"props":935,"children":936},{"style":316},[937],{"type":30,"value":938}," -r\n",{"type":24,"tag":33,"props":940,"children":941},{},[942,944,949,951,955],{"type":30,"value":943},"You should review this list. If there is something with 10k+ extends, it is a candidate to be flagged as ",{"type":24,"tag":72,"props":945,"children":946},{},[947],{"type":30,"value":948},"nodatacow",{"type":30,"value":950},". In my case, I have discovered that the fail2ban sqlite database was using 170k extends which is a lot! If you have database-files with a high fragmentation while using ",{"type":24,"tag":72,"props":952,"children":953},{},[954],{"type":30,"value":948},{"type":30,"value":956},", it is better to run a \"optimize table\" on them, as this also cleans up the database-related fragmentation of frequently rewritten tables. If you use snapshots, make sure to have some free space, as the defrag does an in-place copy of the files while snapshots are blocking the old version from being released.",{"type":24,"tag":25,"props":958,"children":960},{"id":959},"if-everything-is-fine-you-can-go-ahead-and-defrag-all-files-on-that-list",[961],{"type":30,"value":962},"If everything is fine, you can go ahead and defrag all files on that list",{"type":24,"tag":106,"props":964,"children":966},{"className":489,"code":965,"language":491,"meta":7,"style":7},"find / -xdev -type f| xargs filefrag 2>/dev/null | sed 's/^\\(.*\\): \\([0-9]\\+\\) extent.*/\\2 \\1/' |\nawk -F ' ' '$1 > 500' | cut -d ' ' -f2 2>/dev/null | xargs -r btrfs fi defrag -f -v\n",[967],{"type":24,"tag":113,"props":968,"children":969},{"__ignoreMap":7},[970,1030],{"type":24,"tag":117,"props":971,"children":972},{"class":119,"line":120},[973,977,981,985,989,993,997,1001,1005,1009,1013,1017,1021,1025],{"type":24,"tag":117,"props":974,"children":975},{"style":130},[976],{"type":30,"value":835},{"type":24,"tag":117,"props":978,"children":979},{"style":288},[980],{"type":30,"value":840},{"type":24,"tag":117,"props":982,"children":983},{"style":316},[984],{"type":30,"value":845},{"type":24,"tag":117,"props":986,"children":987},{"style":316},[988],{"type":30,"value":850},{"type":24,"tag":117,"props":990,"children":991},{"style":288},[992],{"type":30,"value":855},{"type":24,"tag":117,"props":994,"children":995},{"style":141},[996],{"type":30,"value":860},{"type":24,"tag":117,"props":998,"children":999},{"style":130},[1000],{"type":30,"value":865},{"type":24,"tag":117,"props":1002,"children":1003},{"style":288},[1004],{"type":30,"value":870},{"type":24,"tag":117,"props":1006,"children":1007},{"style":141},[1008],{"type":30,"value":875},{"type":24,"tag":117,"props":1010,"children":1011},{"style":288},[1012],{"type":30,"value":880},{"type":24,"tag":117,"props":1014,"children":1015},{"style":141},[1016],{"type":30,"value":885},{"type":24,"tag":117,"props":1018,"children":1019},{"style":130},[1020],{"type":30,"value":890},{"type":24,"tag":117,"props":1022,"children":1023},{"style":288},[1024],{"type":30,"value":895},{"type":24,"tag":117,"props":1026,"children":1027},{"style":141},[1028],{"type":30,"value":1029}," |\n",{"type":24,"tag":117,"props":1031,"children":1032},{"class":119,"line":197},[1033,1038,1042,1046,1050,1054,1059,1064,1068,1073,1077,1081,1085,1089,1094,1099,1104,1109,1114],{"type":24,"tag":117,"props":1034,"children":1035},{"style":130},[1036],{"type":30,"value":1037},"awk",{"type":24,"tag":117,"props":1039,"children":1040},{"style":316},[1041],{"type":30,"value":909},{"type":24,"tag":117,"props":1043,"children":1044},{"style":288},[1045],{"type":30,"value":914},{"type":24,"tag":117,"props":1047,"children":1048},{"style":288},[1049],{"type":30,"value":919},{"type":24,"tag":117,"props":1051,"children":1052},{"style":141},[1053],{"type":30,"value":885},{"type":24,"tag":117,"props":1055,"children":1056},{"style":130},[1057],{"type":30,"value":1058}," cut",{"type":24,"tag":117,"props":1060,"children":1061},{"style":316},[1062],{"type":30,"value":1063}," -d",{"type":24,"tag":117,"props":1065,"children":1066},{"style":288},[1067],{"type":30,"value":914},{"type":24,"tag":117,"props":1069,"children":1070},{"style":316},[1071],{"type":30,"value":1072}," -f2",{"type":24,"tag":117,"props":1074,"children":1075},{"style":141},[1076],{"type":30,"value":875},{"type":24,"tag":117,"props":1078,"children":1079},{"style":288},[1080],{"type":30,"value":880},{"type":24,"tag":117,"props":1082,"children":1083},{"style":141},[1084],{"type":30,"value":885},{"type":24,"tag":117,"props":1086,"children":1087},{"style":130},[1088],{"type":30,"value":865},{"type":24,"tag":117,"props":1090,"children":1091},{"style":316},[1092],{"type":30,"value":1093}," -r",{"type":24,"tag":117,"props":1095,"children":1096},{"style":288},[1097],{"type":30,"value":1098}," btrfs",{"type":24,"tag":117,"props":1100,"children":1101},{"style":288},[1102],{"type":30,"value":1103}," fi",{"type":24,"tag":117,"props":1105,"children":1106},{"style":288},[1107],{"type":30,"value":1108}," defrag",{"type":24,"tag":117,"props":1110,"children":1111},{"style":316},[1112],{"type":30,"value":1113}," -f",{"type":24,"tag":117,"props":1115,"children":1116},{"style":316},[1117],{"type":30,"value":1118}," -v\n",{"type":24,"tag":33,"props":1120,"children":1121},{},[1122],{"type":30,"value":1123},"This will print out all filenames that are processed.",{"type":24,"tag":25,"props":1125,"children":1127},{"id":1126},"a-short-explanation-of-the-command",[1128],{"type":30,"value":1129},"A short explanation of the command",{"type":24,"tag":33,"props":1131,"children":1132},{},[1133,1137,1139,1143,1145,1150,1152,1157],{"type":24,"tag":72,"props":1134,"children":1135},{},[1136],{"type":30,"value":835},{"type":30,"value":1138}," gets all files on the specified path (/) without descending into other mounted filesystems (-xdev). Then ",{"type":24,"tag":72,"props":1140,"children":1141},{},[1142],{"type":30,"value":818},{"type":30,"value":1144}," determines the fragmentation, the ",{"type":24,"tag":72,"props":1146,"children":1147},{},[1148],{"type":30,"value":1149},"sed",{"type":30,"value":1151}," command reformats the output so that the extent count is on first position followed by the filename. Then awk parses that list filtering only files that have more than 500 extends. After that is done, the output is „cut“ to only contain the filenames and passed to btrfs defrag for defragmentation. -v on the ",{"type":24,"tag":72,"props":1153,"children":1154},{},[1155],{"type":30,"value":1156},"defrag",{"type":30,"value":1158}," command prints out all processed files. Also take a look on the longterm IO usage before and after the defrag to see how big the difference in the real world is.",{"type":24,"tag":25,"props":1160,"children":1162},{"id":1161},"have-fun",[1163],{"type":30,"value":1164},"Have fun!",{"type":24,"tag":554,"props":1166,"children":1167},{},[1168],{"type":30,"value":558},{"title":7,"searchDepth":197,"depth":197,"links":1170},[1171,1172,1173,1174,1175,1176,1177,1178],{"id":713,"depth":197,"text":716},{"id":731,"depth":197,"text":734},{"id":742,"depth":197,"text":745},{"id":794,"depth":197,"text":797},{"id":805,"depth":197,"text":808},{"id":959,"depth":197,"text":962},{"id":1126,"depth":197,"text":1129},{"id":1161,"depth":197,"text":1164},{"_path":585,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":586,"description":587,"author":10,"image":588,"releaseDate":589,"blogCategories":1180,"articleTags":1181,"tags":1182,"body":1183,"_type":564,"_id":593,"_source":566,"_file":594,"_stem":595,"_extension":569},[577,15],[17],[580],{"type":21,"children":1184,"toc":1733},[1185,1191,1196,1201,1217,1230,1236,1264,1281,1287,1292,1305,1318,1347,1382,1403,1457,1474,1501,1544,1573,1623,1642,1655,1697,1709,1729],{"type":24,"tag":25,"props":1186,"children":1188},{"id":1187},"how-to-resolve-selected-domains-over-vpn-on-linux",[1189],{"type":30,"value":1190},"How to resolve selected domains over VPN on Linux",{"type":24,"tag":33,"props":1192,"children":1193},{},[1194],{"type":30,"value":1195},"In today's world, more people than ever use VPN services to work from remote. However, in some cases it's not desirable\nto route all traffic and all domain name resolutions over the VPN connection. Even if the VPN-Server wants the client to\nconfigure itself to work like this, the client can be configured to ignore the request to route all traffic over the VPN\nconnection.",{"type":24,"tag":33,"props":1197,"children":1198},{},[1199],{"type":30,"value":1200},"For example, with Openvpn the option",{"type":24,"tag":106,"props":1202,"children":1206},{"className":1203,"code":1204,"language":1205,"meta":7,"style":7},"language-apache shiki shiki-themes github-dark github-dark monokai","pull-filter ignore redirect-gateway\n","apache",[1207],{"type":24,"tag":113,"props":1208,"children":1209},{"__ignoreMap":7},[1210],{"type":24,"tag":117,"props":1211,"children":1212},{"class":119,"line":120},[1213],{"type":24,"tag":117,"props":1214,"children":1215},{"style":124},[1216],{"type":30,"value":1204},{"type":24,"tag":33,"props":1218,"children":1219},{},[1220,1222,1228],{"type":30,"value":1221},"can be used to tell the ",{"type":24,"tag":113,"props":1223,"children":1225},{"className":1224},[],[1226],{"type":30,"value":1227},"openvpn-client",{"type":30,"value":1229}," to ignore all \"route all\" requests from the server.",{"type":24,"tag":25,"props":1231,"children":1233},{"id":1232},"fritzbox-example",[1234],{"type":30,"value":1235},"FRITZ!Box example",{"type":24,"tag":33,"props":1237,"children":1238},{},[1239,1241,1246,1248,1254,1256,1262],{"type":30,"value":1240},"Recently I had to use a VPN-Connection to a ",{"type":24,"tag":757,"props":1242,"children":1243},{},[1244],{"type":30,"value":1245},"FRITZ!Box",{"type":30,"value":1247},". It's a very popular router in Germany that not only offers\neasy\nVPN-Connections but also adds all hosts on its network to its own dns. If you want to talk to a machine with the name ",{"type":24,"tag":113,"props":1249,"children":1251},{"className":1250},[],[1252],{"type":30,"value":1253}," workstation",{"type":30,"value":1255}," you can reach it using the \"workstation.fritz.box\" dns name. The fritz-box itself is also available on the\ndns name ",{"type":24,"tag":113,"props":1257,"children":1259},{"className":1258},[],[1260],{"type":30,"value":1261},"fritz.box",{"type":30,"value":1263},".",{"type":24,"tag":33,"props":1265,"children":1266},{},[1267,1269,1274,1276,1280],{"type":30,"value":1268},"In my case, I prefer to use my own DNS server for all queries because of speed and privacy reasons - that means, I only\nwant the\ndomains with the ",{"type":24,"tag":113,"props":1270,"children":1272},{"className":1271},[],[1273],{"type":30,"value":1261},{"type":30,"value":1275}," suffix to resolve over the ",{"type":24,"tag":757,"props":1277,"children":1278},{},[1279],{"type":30,"value":1245},{"type":30,"value":1263},{"type":24,"tag":25,"props":1282,"children":1284},{"id":1283},"solution-using-a-local-dns-server-dnsmasq",[1285],{"type":30,"value":1286},"Solution using a local DNS server - dnsmasq",{"type":24,"tag":33,"props":1288,"children":1289},{},[1290],{"type":30,"value":1291},"Dnsmasq is a lightweight DNS-Server that you can run on your machine to get control on how the name resolution works. A\nnice side effect is that it has its own dns cache, making recurring dns queries faster. Here is how I have set it up:",{"type":24,"tag":33,"props":1293,"children":1294},{},[1295,1297,1303],{"type":30,"value":1296},"Before you start you need to find out which DNS server is used on the VPN. It's usually the default gateway that usually\nhas a ",{"type":24,"tag":113,"props":1298,"children":1300},{"className":1299},[],[1301],{"type":30,"value":1302},".1",{"type":30,"value":1304}," at the end. You can watch the VPN logs closely to learn which DNS server gets pushed on connect.",{"type":24,"tag":33,"props":1306,"children":1307},{},[1308,1310,1316],{"type":30,"value":1309},"There is a tool called ",{"type":24,"tag":113,"props":1311,"children":1313},{"className":1312},[],[1314],{"type":30,"value":1315},"dig",{"type":30,"value":1317}," which can do dns queries over specified dns servers, for example",{"type":24,"tag":106,"props":1319,"children":1321},{"className":489,"code":1320,"language":491,"meta":7,"style":7},"dig @192.168.1.1 a fritz.box\n",[1322],{"type":24,"tag":113,"props":1323,"children":1324},{"__ignoreMap":7},[1325],{"type":24,"tag":117,"props":1326,"children":1327},{"class":119,"line":120},[1328,1332,1337,1342],{"type":24,"tag":117,"props":1329,"children":1330},{"style":130},[1331],{"type":30,"value":1315},{"type":24,"tag":117,"props":1333,"children":1334},{"style":288},[1335],{"type":30,"value":1336}," @192.168.1.1",{"type":24,"tag":117,"props":1338,"children":1339},{"style":288},[1340],{"type":30,"value":1341}," a",{"type":24,"tag":117,"props":1343,"children":1344},{"style":288},[1345],{"type":30,"value":1346}," fritz.box\n",{"type":24,"tag":33,"props":1348,"children":1349},{},[1350,1352,1358,1360,1365,1367,1373,1375,1381],{"type":30,"value":1351},"will ask the dns server ",{"type":24,"tag":113,"props":1353,"children":1355},{"className":1354},[],[1356],{"type":30,"value":1357},"192.168.1.1",{"type":30,"value":1359}," for the ip of ",{"type":24,"tag":113,"props":1361,"children":1363},{"className":1362},[],[1364],{"type":30,"value":1261},{"type":30,"value":1366},". ",{"type":24,"tag":113,"props":1368,"children":1370},{"className":1369},[],[1371],{"type":30,"value":1372},"Dig",{"type":30,"value":1374}," is very handy when debugging dns problems and to\ntest\nyour setup. You may have to install it on your System. On debian, it lives in a package called ",{"type":24,"tag":113,"props":1376,"children":1378},{"className":1377},[],[1379],{"type":30,"value":1380},"dnsutils",{"type":30,"value":1263},{"type":24,"tag":33,"props":1383,"children":1384},{},[1385,1387,1393,1395,1401],{"type":30,"value":1386},"First install ",{"type":24,"tag":113,"props":1388,"children":1390},{"className":1389},[],[1391],{"type":30,"value":1392},"dnsmasq",{"type":30,"value":1394}," on your Linux and edit its configuration (usually lives in ",{"type":24,"tag":113,"props":1396,"children":1398},{"className":1397},[],[1399],{"type":30,"value":1400},"/etc/dnsmasq.conf",{"type":30,"value":1402},"). Add these lines\nhere:",{"type":24,"tag":106,"props":1404,"children":1406},{"className":1203,"code":1405,"language":1205,"meta":7,"style":7},"resolv-file=/etc/resolv.dnsmasq.conf\nserver=/fritz.box/192.168.1.1\n",[1407],{"type":24,"tag":113,"props":1408,"children":1409},{"__ignoreMap":7},[1410,1418],{"type":24,"tag":117,"props":1411,"children":1412},{"class":119,"line":120},[1413],{"type":24,"tag":117,"props":1414,"children":1415},{"style":124},[1416],{"type":30,"value":1417},"resolv-file=/etc/resolv.dnsmasq.conf\n",{"type":24,"tag":117,"props":1419,"children":1420},{"class":119,"line":197},[1421,1426,1431,1435,1440,1444,1448,1452],{"type":24,"tag":117,"props":1422,"children":1423},{"style":124},[1424],{"type":30,"value":1425},"server=/fritz.box/",{"type":24,"tag":117,"props":1427,"children":1428},{"style":316},[1429],{"type":30,"value":1430},"192",{"type":24,"tag":117,"props":1432,"children":1433},{"style":124},[1434],{"type":30,"value":1263},{"type":24,"tag":117,"props":1436,"children":1437},{"style":316},[1438],{"type":30,"value":1439},"168",{"type":24,"tag":117,"props":1441,"children":1442},{"style":124},[1443],{"type":30,"value":1263},{"type":24,"tag":117,"props":1445,"children":1446},{"style":316},[1447],{"type":30,"value":698},{"type":24,"tag":117,"props":1449,"children":1450},{"style":124},[1451],{"type":30,"value":1263},{"type":24,"tag":117,"props":1453,"children":1454},{"style":316},[1455],{"type":30,"value":1456},"1\n",{"type":24,"tag":33,"props":1458,"children":1459},{},[1460,1465,1467,1472],{"type":24,"tag":113,"props":1461,"children":1463},{"className":1462},[],[1464],{"type":30,"value":1261},{"type":30,"value":1466}," is the domain you want to resolve over the VPN-Dns-server, ",{"type":24,"tag":113,"props":1468,"children":1470},{"className":1469},[],[1471],{"type":30,"value":1357},{"type":30,"value":1473}," in this example.",{"type":24,"tag":33,"props":1475,"children":1476},{},[1477,1479,1484,1486,1491,1493,1499],{"type":30,"value":1478},"The ",{"type":24,"tag":757,"props":1480,"children":1481},{},[1482],{"type":30,"value":1483},"Resolv-File",{"type":30,"value":1485}," will tell ",{"type":24,"tag":113,"props":1487,"children":1489},{"className":1488},[],[1490],{"type":30,"value":1392},{"type":30,"value":1492}," how it should resolve its dns queries in case there are no other rules, so let's\ncreate\na ",{"type":24,"tag":113,"props":1494,"children":1496},{"className":1495},[],[1497],{"type":30,"value":1498},"/etc/resolv.dnsmasq.conf",{"type":30,"value":1500},"\nwith content",{"type":24,"tag":106,"props":1502,"children":1504},{"className":1203,"code":1503,"language":1205,"meta":7,"style":7},"nameserver 1.1.1.1\n",[1505],{"type":24,"tag":113,"props":1506,"children":1507},{"__ignoreMap":7},[1508],{"type":24,"tag":117,"props":1509,"children":1510},{"class":119,"line":120},[1511,1516,1520,1524,1528,1532,1536,1540],{"type":24,"tag":117,"props":1512,"children":1513},{"style":124},[1514],{"type":30,"value":1515},"nameserver ",{"type":24,"tag":117,"props":1517,"children":1518},{"style":316},[1519],{"type":30,"value":698},{"type":24,"tag":117,"props":1521,"children":1522},{"style":124},[1523],{"type":30,"value":1263},{"type":24,"tag":117,"props":1525,"children":1526},{"style":316},[1527],{"type":30,"value":698},{"type":24,"tag":117,"props":1529,"children":1530},{"style":124},[1531],{"type":30,"value":1263},{"type":24,"tag":117,"props":1533,"children":1534},{"style":316},[1535],{"type":30,"value":698},{"type":24,"tag":117,"props":1537,"children":1538},{"style":124},[1539],{"type":30,"value":1263},{"type":24,"tag":117,"props":1541,"children":1542},{"style":316},[1543],{"type":30,"value":1456},{"type":24,"tag":33,"props":1545,"children":1546},{},[1547,1549,1555,1557,1563,1565,1571],{"type":30,"value":1548},"If you use a static network configuration, you now can just edit it to use ",{"type":24,"tag":113,"props":1550,"children":1552},{"className":1551},[],[1553],{"type":30,"value":1554},"127.0.0.1",{"type":30,"value":1556}," as its nameserver. If you use\nautomatic ip configuration using dhcp, you need to configure your dhcp client use the new local dns server. On debian,\nthe default is ",{"type":24,"tag":113,"props":1558,"children":1560},{"className":1559},[],[1561],{"type":30,"value":1562},"dhclient",{"type":30,"value":1564},". In that case edit ",{"type":24,"tag":113,"props":1566,"children":1568},{"className":1567},[],[1569],{"type":30,"value":1570},"/etc/dhcp/dhclient.conf",{"type":30,"value":1572}," and add:",{"type":24,"tag":106,"props":1574,"children":1576},{"className":1203,"code":1575,"language":1205,"meta":7,"style":7},"prepend domain-name-servers 127.0.0.1;\n",[1577],{"type":24,"tag":113,"props":1578,"children":1579},{"__ignoreMap":7},[1580],{"type":24,"tag":117,"props":1581,"children":1582},{"class":119,"line":120},[1583,1588,1593,1597,1602,1606,1610,1614,1618],{"type":24,"tag":117,"props":1584,"children":1585},{"style":124},[1586],{"type":30,"value":1587},"prepend domain-name-servers ",{"type":24,"tag":117,"props":1589,"children":1590},{"style":316},[1591],{"type":30,"value":1592},"127",{"type":24,"tag":117,"props":1594,"children":1595},{"style":124},[1596],{"type":30,"value":1263},{"type":24,"tag":117,"props":1598,"children":1599},{"style":316},[1600],{"type":30,"value":1601},"0",{"type":24,"tag":117,"props":1603,"children":1604},{"style":124},[1605],{"type":30,"value":1263},{"type":24,"tag":117,"props":1607,"children":1608},{"style":316},[1609],{"type":30,"value":1601},{"type":24,"tag":117,"props":1611,"children":1612},{"style":124},[1613],{"type":30,"value":1263},{"type":24,"tag":117,"props":1615,"children":1616},{"style":316},[1617],{"type":30,"value":698},{"type":24,"tag":117,"props":1619,"children":1620},{"style":124},[1621],{"type":30,"value":1622},";\n",{"type":24,"tag":33,"props":1624,"children":1625},{},[1626,1628,1633,1635,1640],{"type":30,"value":1627},"That's it. All you have to do now is to restart ",{"type":24,"tag":113,"props":1629,"children":1631},{"className":1630},[],[1632],{"type":30,"value":1392},{"type":30,"value":1634}," so it reloads its config and reconnect/restart ",{"type":24,"tag":113,"props":1636,"children":1638},{"className":1637},[],[1639],{"type":30,"value":1562},{"type":30,"value":1641},"\n(disconnecting and reconnecting the network may work, reboot the machine when in doubt).",{"type":24,"tag":33,"props":1643,"children":1644},{},[1645,1647,1653],{"type":30,"value":1646},"Now you can check if the file ",{"type":24,"tag":113,"props":1648,"children":1650},{"className":1649},[],[1651],{"type":30,"value":1652},"/etc/resolv.conf",{"type":30,"value":1654}," has",{"type":24,"tag":106,"props":1656,"children":1658},{"className":1203,"code":1657,"language":1205,"meta":7,"style":7},"nameserver 127.0.0.1\n",[1659],{"type":24,"tag":113,"props":1660,"children":1661},{"__ignoreMap":7},[1662],{"type":24,"tag":117,"props":1663,"children":1664},{"class":119,"line":120},[1665,1669,1673,1677,1681,1685,1689,1693],{"type":24,"tag":117,"props":1666,"children":1667},{"style":124},[1668],{"type":30,"value":1515},{"type":24,"tag":117,"props":1670,"children":1671},{"style":316},[1672],{"type":30,"value":1592},{"type":24,"tag":117,"props":1674,"children":1675},{"style":124},[1676],{"type":30,"value":1263},{"type":24,"tag":117,"props":1678,"children":1679},{"style":316},[1680],{"type":30,"value":1601},{"type":24,"tag":117,"props":1682,"children":1683},{"style":124},[1684],{"type":30,"value":1263},{"type":24,"tag":117,"props":1686,"children":1687},{"style":316},[1688],{"type":30,"value":1601},{"type":24,"tag":117,"props":1690,"children":1691},{"style":124},[1692],{"type":30,"value":1263},{"type":24,"tag":117,"props":1694,"children":1695},{"style":316},[1696],{"type":30,"value":1456},{"type":24,"tag":33,"props":1698,"children":1699},{},[1700,1702,1707],{"type":30,"value":1701},"as first nameserver. If it has, the selected domain (",{"type":24,"tag":113,"props":1703,"children":1705},{"className":1704},[],[1706],{"type":30,"value":1261},{"type":30,"value":1708}," in my example) should now resolve.",{"type":24,"tag":33,"props":1710,"children":1711},{},[1712,1714,1719,1721,1727],{"type":30,"value":1713},"On ",{"type":24,"tag":113,"props":1715,"children":1717},{"className":1716},[],[1718],{"type":30,"value":1392},{"type":30,"value":1720},", you can add multiple ",{"type":24,"tag":113,"props":1722,"children":1724},{"className":1723},[],[1725],{"type":30,"value":1726},"server=",{"type":30,"value":1728}," lines, which comes in handy if you have multiple domains that need to be\nresolved over different DNS servers.",{"type":24,"tag":554,"props":1730,"children":1731},{},[1732],{"type":30,"value":558},{"title":7,"searchDepth":197,"depth":197,"links":1734},[1735,1736,1737],{"id":1187,"depth":197,"text":1190},{"id":1232,"depth":197,"text":1235},{"id":1283,"depth":197,"text":1286},{"_path":600,"_dir":601,"_draft":6,"_partial":6,"_locale":7,"slug":10,"teams":1739,"primaryTeam":604,"firstName":605,"lastName":606,"prefixTitle":7,"suffixTitle":7,"education":1740,"executiveRole":612,"role":1742,"workingSince":621,"inTheCompanySince":622,"techSkills":1743,"skills":1760,"projects":1767,"contactDetails":1773,"_image":699,"image":700,"_id":701,"_type":702,"title":703,"_source":601,"_file":704,"_stem":705,"_extension":702},[603,604],[1741],[609,610,611],[614,615,604,616,617,618,619,620],[1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759],{"name":625,"level":626,"icon":627},{"name":629,"level":626,"icon":630},{"name":632,"level":626},{"name":634,"level":626,"icon":635},{"name":637,"level":626},{"name":639,"level":626,"icon":640},{"name":642,"level":626},{"name":644,"level":626},{"name":646,"level":626},{"name":648,"level":626,"icon":649},{"name":651,"level":652,"icon":653},{"name":655,"level":652,"icon":656},{"name":658,"level":652,"icon":659},{"name":661,"level":652,"icon":662},{"name":664,"level":652,"icon":665},{"name":667,"level":652,"icon":668},[1761,1762,1763,1764,1765,1766],{"name":671,"level":626},{"name":673,"level":626},{"name":675,"level":626},{"name":677,"level":626},{"name":679,"level":626},{"name":681,"level":652},[1768,1769,1770,1771,1772],{"project":684,"position":685},{"project":687,"position":685},{"project":689,"position":685},{"project":691,"position":692},{"project":694,"position":685},{"eMail":696,"phone":697,"visibility":698},[1775,1790],{"_path":1776,"_dir":1777,"_draft":6,"_partial":340,"_locale":7,"name":1778,"slug":1777,"text":1779,"hoverText":1780,"image":1781,"customer":1782,"tags":1783,"_id":1785,"_type":1786,"title":1787,"_source":566,"_file":1788,"_stem":1789,"_extension":1786},"/en/portfolio/bitburger/_teaser","bitburger","Bitburger B2B and Brand Shops","Relaunch of Bitburger Brewery Group online shops with new platform","Migration of all brand shops and B2B shop of Bitburger Brewery Group to a unified platform. Ongoing support for redesign initiatives and integration of additional subsystems.","/images/portfolio/bitburger/Bitburger_HuW_Glaeser.jpg","Bitburger",[19,1784],"e-commerce","common:en:portfolio:900.bitburger:_teaser.yaml","yaml","Teaser","en/portfolio/900.bitburger/_teaser.yaml","en/portfolio/900.bitburger/_teaser",{"_path":1791,"_dir":1792,"_draft":6,"_partial":340,"_locale":7,"name":1793,"slug":1792,"text":1794,"hoverText":1795,"image":1796,"customer":1797,"tags":1798,"_id":1799,"_type":1786,"title":1787,"_source":566,"_file":1800,"_stem":1801,"_extension":1786},"/en/portfolio/purize/_teaser","purize","Purize Filters","E-Commerce for high-quality activated carbon filters","We support PURIZE® Filters with a complete e-commerce service including fulfillment solution and connection to shipping service providers. Our expertise in online retail enables the manufacturer of high-quality activated carbon filters \"Made in Germany\" to process their orders smoothly.","/images/portfolio/barcode-machine-verdandijpg.jpg","PURIZE® Filters",[19,1784],"common:en:portfolio:9000.purize:_teaser.yaml","en/portfolio/9000.purize/_teaser.yaml","en/portfolio/9000.purize/_teaser",1782284053692]