We study the asymptotic behavior of solutions and eigenelements of boundary-value problems with rapidly alternating type of boundary conditions in the domain $$\Omega \subset \mathbb{R}^n $$ . The density, which depends on a small parameter ɛ, is of the order of O(1) outside small inclusions, where the density is of the order of $$O((\varepsilon \delta )^{ - m} )$$ . These domains, i.e., concentrated masses of diameter $$O(\varepsilon \delta )$$ , are located near the boundary at distances of the order of $$O(\delta )$$ from each other, where $$\delta = \delta (\varepsilon ) \to 0$$ . We pose the Dirichlet condition (respectively, the Neumann condition) on the parts of the boundary $$\partial \Omega $$ that are tangent (respectively, lying outside) the concentrated masses. We estimate the deviations of the solutions of the limit (averaged) problems from the solutions of the original problems in the norm of the Sobolev space $$W_2^1 $$ for $$m < 2$$ .